Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Named Range is a formula

Hello

When a named range is a formula and not a range, how does one refer to it in
code.

Normally for example: workbook.worksheet.range("abc")

but since there is no sheet identified with the named range as formula i
cannot figure out how to call its value in the code.

Please help.

W


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Named Range is a formula

ThisWorkbook.Names("abc").RefersTo

This is not a range. It is just a named formula.

--

Vasant



"cogent" wrote in message
...
Hello

When a named range is a formula and not a range, how does one refer to it

in
code.

Normally for example: workbook.worksheet.range("abc")

but since there is no sheet identified with the named range as formula i
cannot figure out how to call its value in the code.

Please help.

W




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Named Range is a formula

Hi W

if you want the result of the named formula rather than the formula itself
then use Evaluate

if namedformula has a refersto of =5*2/3 you will get 3.3333 returned to
vArr

dim vArr as variant
varr=application.evaluate("NamedFormula")

or
varr=[NamedFormula]

for a general purpose wrapper function for Evaluate see
http://www.decisionModels.com/calcsecretsh.htm

regards
Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com/FxlV2WhatsNew.htm

"cogent" wrote in message
...
Hello

When a named range is a formula and not a range, how does one refer to it

in
code.

Normally for example: workbook.worksheet.range("abc")

but since there is no sheet identified with the named range as formula i
cannot figure out how to call its value in the code.

Please help.

W




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
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Excel Discussion (Misc queries) 11 December 28th 06 04:44 PM
Formula for named range TUNGANA KURMA RAJU Excel Discussion (Misc queries) 2 July 1st 06 05:41 AM
named range into formula? heymoa Excel Worksheet Functions 4 May 22nd 06 02:05 PM
Count formula within a named range. PW11111 Excel Discussion (Misc queries) 2 July 19th 05 09:29 AM
using a Named Range (formula) in a UDF Sean Maguire Excel Programming 1 May 25th 04 08:27 PM


All times are GMT +1. The time now is 09:31 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"