Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel2000: Reading Named Range value from VBA
Hi
Is it possible at all, and when yes, then how? To be more specific, I want to write an workbook Open event, where I need the current weeknumber string in format "yyyy.ww". There is a named range/function CurrWeek defined in workbook, which returns exactly the value I need, but how do I get it? I checked with Watch window, and the expression: ActiveWorkbook.Names("CurrWeek") doesn't return "2004.28" today - instead it returns "=INDEX(Weeks_Week,MATCH(VLOOKUP(TODAY(),Weeks_Sta rt,1,1),Weeks_Start,0))" i.e. the 'Refers To' part of name definition (Weeks_Week and Weeks_Start are named ranges which do return ranges from a table). And the same with: ActiveWorkbook.Names("CurrWeek").Value -- Arvi Laanemets (When sending e-mail, use address arvil<Attarkon.ee) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel2000: Reading Named Range value from VBA
Hi Arvi,
try either [CurrWeek] or Application.evaluate("CurrWeek") regards Charles ______________________ Decision Models The Excel Calculation Site. www.DecisionModels.com "Arvi Laanemets" wrote in message ... Hi Is it possible at all, and when yes, then how? To be more specific, I want to write an workbook Open event, where I need the current weeknumber string in format "yyyy.ww". There is a named range/function CurrWeek defined in workbook, which returns exactly the value I need, but how do I get it? I checked with Watch window, and the expression: ActiveWorkbook.Names("CurrWeek") doesn't return "2004.28" today - instead it returns "=INDEX(Weeks_Week,MATCH(VLOOKUP(TODAY(),Weeks_Sta rt,1,1),Weeks_Start,0))" i.e. the 'Refers To' part of name definition (Weeks_Week and Weeks_Start are named ranges which do return ranges from a table). And the same with: ActiveWorkbook.Names("CurrWeek").Value -- Arvi Laanemets (When sending e-mail, use address arvil<Attarkon.ee) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel2000: Reading Named Range value from VBA
Thanks! It works!
Arvi Laanemets |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel2000:How to link Print Area with a named range | Excel Discussion (Misc queries) | |||
Excel2000:How to link Print Area with a named range | Excel Worksheet Functions | |||
Excel2000: Custom data validation and named ranges | Excel Discussion (Misc queries) | |||
Excel2000: finding last row of used range | Excel Programming | |||
Reading a named range | Excel Programming |