• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Navigate to a NamedRange from current worksheet to another Worksheet

inddon

Member
Hello There,

I have a few NamedRange(s) defined in Sheet1 & Sheet2

When the user hits enter key on the last named range in Sheet1, the control should go to the first named range in Sheet2 (namedrange "FDescription"). But it doesn't

Below code:

This doesn't work:
Code:
Worksheets("Sheet2").Range("FDescription").Select


This works:
Code:
Worksheets("Sheet2").Select
Worksheets("Sheet2").Range("FDescription").Select


I would like to know what is wrong in the first code as it does not navigate to worksheet "Sheet2"


Thanks & regards,
Don
 
You can't select something on an inactive sheet.
You can still do it in one line though:
Code:
Application.Goto Worksheets("Sheet2").Range("FDescription")
If the range name has a workbook scope you'll get away with:
Code:
Application.Goto Range("FDescription")
 
You can't select something on an inactive sheet.
You can still do it in one line though:
Code:
Application.Goto Worksheets("Sheet2").Range("FDescription")
If the range name has a workbook scope you'll get away with:
Code:
Application.Goto Range("FDescription")


Thank you p45cal for your tips. Learned something new today :)
 
Back
Top