Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Excel2000: Reading Named Range value from VBA

Thanks! It works!

Arvi Laanemets


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel2000:How to link Print Area with a named range Arvi Laanemets Excel Discussion (Misc queries) 5 April 8th 08 02:35 PM
Excel2000:How to link Print Area with a named range Arvi Laanemets Excel Worksheet Functions 5 April 8th 08 02:35 PM
Excel2000: Custom data validation and named ranges Arvi Laanemets Excel Discussion (Misc queries) 9 December 10th 04 07:05 PM
Excel2000: finding last row of used range Arvi Laanemets Excel Programming 2 May 10th 04 08:54 AM
Reading a named range Karl Thompson Excel Programming 1 July 10th 03 02:29 AM


All times are GMT +1. The time now is 01:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"