Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Referencing the worksheet name in an excel function

Does anyone mknow how I would reference "Sheet2" to a cell in a worksheet
Need to be able to change the worksheet name based on a cell

Thanks

='C:\Documents and Settings\FP&A\Templates\[SMP2Data.xls]Sheet2'!$A$1
--
Helping Is always a good thing
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Referencing the worksheet name in an excel function

If you want to know the name of the sheet of a range passed as a parameter
use

Rnge.Parent.Name

If you want to know the name of the sheet that contain the call to the UDF
use
Application.Caller.Parent.Name

If you want to know the contents of a cell that contains a sheet name use
Rnge.Value

Be careful that all references to cells are passed as parameters to your
function so that Excel knows to recalculate your function whenever any of
the cells change. Otherwise you will have to make your function Volatile,
which is slow.

regards
Charles
__________________________________________________
The Excel Calculation Site
http://www.decisionmodels.com

"QuietMan" wrote in message
...
Does anyone mknow how I would reference "Sheet2" to a cell in a worksheet
Need to be able to change the worksheet name based on a cell

Thanks

='C:\Documents and Settings\FP&A\Templates\[SMP2Data.xls]Sheet2'!$A$1
--
Helping Is always a good thing



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
Excel 2007 - referencing a cell value from another worksheet withi crisg Excel Discussion (Misc queries) 7 February 9th 09 10:24 PM
excel, what if function referencing another cell MARY Excel Worksheet Functions 3 June 13th 08 03:31 PM
Offset function referencing worksheet Jeff Excel Discussion (Misc queries) 1 September 11th 05 07:01 PM
Excel Function referencing another sheet josh Excel Programming 2 June 24th 04 09:36 PM
Selection method not available in VB when referencing Excel worksheet Oscar Excel Programming 11 December 8th 03 09:01 PM


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