Using Named Ranges in VB

R

Rocky Bryant

Hello,

In WkBk1 I have defined a dynamic range dR which points
to cells in WkBk2. Code in Module1 in WkBk1 I want to
Select dR. so I do the following.

Range(dR).Select


but this line seems to be giving me an error. Can you
actually us a Named Range in VB code? And how would I
accomplish this?

thanks for you help,

Rocky
 
R

Ron de Bruin

Hi Rocky

You can't select a range in a other workbook this way.
First you must make the workbook and the sheet active.

You don't have to select the cells if you wnat to do wht you want maybe?
What do you want to do?
 
J

Jake Marx

Ron said:
You can't select a range in a other workbook this way.
First you must make the workbook and the sheet active.

Or you can use Application.Goto to change the selection to a cell in another
worksheet and/or workbook:

Application.Goto Workbooks("other").Sheets(1).Range("C150")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top