Thread
:
Retrieving Values Saved in Names
View Single Post
#
9
Posted to microsoft.public.excel.programming
Steve Drenker[_3_]
external usenet poster
Posts: 5
Retrieving Values Saved in Names
Rob & Tom...thanks much for both techniques. Much simpler than iterating
over all 225+ names in my solution.
Steve
in article
, Rob Bovey at
wrote on 3/3/06 6:58 PM:
Hi Steve,
If you're trying to get the name from within the same workbook where
it's defined then the following will work for a workbook-level name:
Dim lYear As Long
lYear = Application.Evaluate("Base_Year")
for a sheet-level name you'll need to specify the worksheet it belongs to:
lYear = Application.Evaluate("MySheet!Base_Year")
To retrieve the name from a different workbook you should fully qualify the
location of the name, like so:
lYear = Application.Evaluate("[Book1.xls]MySheet!Base_Year")
Reply With Quote
Steve Drenker[_3_]
View Public Profile
Find all posts by Steve Drenker[_3_]