Link to home
Start Free TrialLog in
Avatar of mlagrange
mlagrangeFlag for United States of America

asked on

How to resize a named range?

Hello - I'm an Access developer, familiar with VBA, but no so much the Excel object model. I have been stuck on how to resize a named range, and found the following article:

http://www.mrexcel.com/td0131.html

...which has the following paragraph:

There is an easier method for assigning a range name. The following four statements are all equivalent. The last two are vastly easier:
ActiveWorkbook.Names.Add Name:="TheData", RefersToR1C1:="=Sheet1!R1C1:R10C5"
ActiveWorkbook.Names.Add Name:="TheData", RefersTo:="=Sheet1!A1:E10"
Range("A1:E10").Name = "TheData"
Cells(1, 1).Resize(10, 5).Name = "TheData"

What does the reference to "Cells(1,1)" get you?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Steve
Steve
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mlagrange

ASKER

Barman - so it's just the starting/upper left corner of the range you want to resize, then? I had seen other ref's like "Cells(1)", and wasn't sure what was going on there...

Thanks, Spattewar