Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Newbie question re Worksheet Name

Hi All,

I'm fairly new to Excel and am looking for a way to insert the
Worksheet Name into a cell as part of a function.

I have a cell that contains this:

=COUNT('C:\[Refunds 2007-08.xls]Apr'!$A:$A)


And the following function that returns the Worksheet Name:

Function SheetName(rAnyCell)
Application.Volatile
SheetName = rAnyCell.Parent.Name
End Function


What I want to do is replace the "2007-08" bit in the COUNT function
with my own function so that the correct filename to count is
dynamically generated from the worksheet name.

Anyone know how to do this? I'm sure it's quite simple but it's got me
stumped!!

Any help would be much appreciated :D

Regards,

Jason

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Newbie question re Worksheet Name

You can use the INDIRECT function to build up a reference in the
manner you suggest. However, this will only work with open workbooks.

Hope this helps.

Pete

On May 2, 4:06 pm, Jason wrote:
Hi All,

I'm fairly new to Excel and am looking for a way to insert the
Worksheet Name into a cell as part of a function.

I have a cell that contains this:

=COUNT('C:\[Refunds 2007-08.xls]Apr'!$A:$A)

And the following function that returns the Worksheet Name:

Function SheetName(rAnyCell)
Application.Volatile
SheetName = rAnyCell.Parent.Name
End Function

What I want to do is replace the "2007-08" bit in the COUNT function
with my own function so that the correct filename to count is
dynamically generated from the worksheet name.

Anyone know how to do this? I'm sure it's quite simple but it's got me
stumped!!

Any help would be much appreciated :D

Regards,

Jason



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Newbie question re Worksheet Name

The best way i found is to have both files open (at half size so you can see
both in excel) and when typing the formula into one spreadsheet, when you get
to the point where you need the name entered you can click on any cell in the
other file, this should give you the file name and cell number (for example
A2) just delete this back to give you just the database name. I'm not sure if
that is any use, but that's how i do it.

"Jason" wrote:

Hi All,

I'm fairly new to Excel and am looking for a way to insert the
Worksheet Name into a cell as part of a function.

I have a cell that contains this:

=COUNT('C:\[Refunds 2007-08.xls]Apr'!$A:$A)


And the following function that returns the Worksheet Name:

Function SheetName(rAnyCell)
Application.Volatile
SheetName = rAnyCell.Parent.Name
End Function


What I want to do is replace the "2007-08" bit in the COUNT function
with my own function so that the correct filename to count is
dynamically generated from the worksheet name.

Anyone know how to do this? I'm sure it's quite simple but it's got me
stumped!!

Any help would be much appreciated :D

Regards,

Jason


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
Newbie question Ekaterina Charts and Charting in Excel 2 January 30th 07 06:59 PM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Newbie Question Pete B Excel Discussion (Misc queries) 0 December 29th 05 11:27 AM
Newbie With A Question Michael Excel Worksheet Functions 0 July 28th 05 11:50 PM


All times are GMT +1. The time now is 09:27 AM.

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

About Us

"It's about Microsoft Excel"