views:

55

answers:

4

I setup a "Name" to a column range, and I want to reference it later on:

Dim r As Range
r = Application.Names("Changes").Something

I've tried a bunch of "Something" but cannot get this right. Thanks.

+1  A: 

Do either RefersTo or RefersToRange work?

Jacob G
+1  A: 

does this work?

Dim R As Range
Set R = ThisWorkbook.Names("Changes").RefersToRange

I think it will only work if the range is 2 cells or more. If it is one you have to do something else...don't really remember though.

Another way is as follows.

Sheets("Name").Range("Changes")
thomas
+2  A: 
dim r as Range
Set r = Range("Changes")

The 'Set' keyword is very important.

This will work for any size range, including a single cell.

Then you can access the properties and methods of your range variable 'r'.

Stewbob
Set seems to have done it, thanks!
Timmy
+1  A: 

Try:

Set r = Application.Names("Changes").RefersToRange
Mark