Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extracting Sheet Name

I'd like to create a worksheet function that will take as input a cell
reference or range, and will return the name of the worksheet that the input
cell/range is on. For example, I would like to be able to enter a function
with this general name/form:

=Sheetname('Sheet1'!A1)

and get the following text:

Sheet1

Thanks for any help!

Nick



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Extracting Sheet Name

Nick,

You can use a VBA function like the following:

Function GetSheetName(R As Range) As String
GetSheetName = R.Worksheet.Name
End Function

Then, call it from a worksheet cell with
=GetSheetName(Sheet3!A1)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Nick H" wrote in message
...
I'd like to create a worksheet function that will take as input

a cell
reference or range, and will return the name of the worksheet

that the input
cell/range is on. For example, I would like to be able to

enter a function
with this general name/form:

=Sheetname('Sheet1'!A1)

and get the following text:

Sheet1

Thanks for any help!

Nick





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
Extracting Specific Data from one sheet to another. Pulling Data from one sheet to another. Excel Worksheet Functions 1 July 14th 08 10:42 PM
Extracting data from one sheet into another T Excel Worksheet Functions 2 February 8th 08 06:24 PM
Please help. Extracting data from one sheet to another leeannemat New Users to Excel 2 February 11th 06 02:55 PM
Extracting information from records to another sheet automatically Max Excel Worksheet Functions 0 February 4th 06 05:27 PM
help extracting data from an excel sheet Tina Jones Excel Worksheet Functions 4 April 25th 05 01:18 AM


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