Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default How to create a 'name' which is not worksheet spcific

Hello,
I need to refer to a range of cells in a function. Same function is used in
different worksheets of same workbook. The name when used in a specific page
should refer to the cells from that page.
ie.,
I have defined a name as myname =a1:d5
when used in sheet sheet1, myname should give = 'sheet1'!a1:d5
when used in sheet sheet2, myname should give = 'sheet2'!a1:d5 like that...

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 968
Default How to create a 'name' which is not worksheet spcific

Function BJ()

dim oRng as range
Application.volatile

set orng=application.caller.parent.range("A1:D5")
.......
BJ= ...
end function


or if you want to use a name then

Myname=INDIRECT("A1:D5)

in both cases you would need to define the function as volatile because the
range is not referenced in the argument list for the function so Excel does
not know when to recalculate the function:
in general you should try to avoid using Application.volatile


--
Charles
______________________
Decision Models
FastExcel 2.2 Beta now available

www.DecisionModels.com
"bj" wrote in message
...
Hello,
I need to refer to a range of cells in a function. Same function is used
in
different worksheets of same workbook. The name when used in a specific
page
should refer to the cells from that page.
ie.,
I have defined a name as myname =a1:d5
when used in sheet sheet1, myname should give = 'sheet1'!a1:d5
when used in sheet sheet2, myname should give = 'sheet2'!a1:d5 like
that...

Thanks



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
Can I create a worksheet menu to select each other worksheet pippagrace Excel Discussion (Misc queries) 4 June 23rd 06 01:28 PM
create a list base on another worksheet tikchye_oldLearner57 Excel Discussion (Misc queries) 2 May 17th 06 01:58 PM
How do I create an Excel worksheet with a limited no. of rows? WarTech Excel Discussion (Misc queries) 4 November 21st 05 01:22 PM
quickly create extra copies of a worksheet template in a workbook simon Excel Worksheet Functions 2 October 23rd 05 07:04 PM
Create a "recap" worksheet that includes all info from all worksh. tdglaw Excel Worksheet Functions 1 February 2nd 05 04:48 PM


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