ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Accessing Named Ranges (https://www.excelbanter.com/excel-programming/275456-accessing-named-ranges.html)

Michael Monteiro

Accessing Named Ranges
 
Can I access a named range defined on sheet1 from sheet2?
I have a loop that iterates though Application.Names and I
can see the named range I am interested in. However, I
cannot access it via Range(Application.Names("foo")). I
get an exception when I do. Is this expected behavior? Any
way around this?

Tom Ogilvy

Accessing Named Ranges
 
set rng = Workbooks(2).Names("foo").RefersToRange

would be one way.

Regards,
Tom Ogilvy

"Michael Monteiro" wrote in message
...
Can I access a named range defined on sheet1 from sheet2?
I have a loop that iterates though Application.Names and I
can see the named range I am interested in. However, I
cannot access it via Range(Application.Names("foo")). I
get an exception when I do. Is this expected behavior? Any
way around this?





All times are GMT +1. The time now is 08:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com