Question

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.

Was it helpful?

Solution

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'.

OTHER TIPS

Try:

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

Do either RefersTo or RefersToRange work?

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")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top