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

Hello:

I would like to write a custom formula that will give the name of the sheet.
The formula should work something like this: =SheetName(X), and X represents
the sheet number in that worksheet.

Please let me know.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Sheet Name Formula

Hi,

How about a UDF.

Alt +F11 to open VB editor. Right click 'This Workbook' and sert module and
paste the code below in on the right.

call with
=Sheetname(n) wher n is the sheet number. I've included 2 options the sheet
name as appears on the Tab or the sheet codename. Use which one you want.

Function sheetname(cdname As Integer)
sheetname = Sheets(cdname).CodeName
'sheetname = Sheets(cdname).Name
End Function

Mike

"art" wrote:

Hello:

I would like to write a custom formula that will give the name of the sheet.
The formula should work something like this: =SheetName(X), and X represents
the sheet number in that worksheet.

Please let me know.

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Sheet Name Formula

Thanks, this is exactly what I needed. It's much easier to use then using the
Filename.... Formula.

"Mike H" wrote:

Hi,

How about a UDF.

Alt +F11 to open VB editor. Right click 'This Workbook' and sert module and
paste the code below in on the right.

call with
=Sheetname(n) wher n is the sheet number. I've included 2 options the sheet
name as appears on the Tab or the sheet codename. Use which one you want.

Function sheetname(cdname As Integer)
sheetname = Sheets(cdname).CodeName
'sheetname = Sheets(cdname).Name
End Function

Mike

"art" wrote:

Hello:

I would like to write a custom formula that will give the name of the sheet.
The formula should work something like this: =SheetName(X), and X represents
the sheet number in that worksheet.

Please let me know.

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
Formula to copy related information from sheet 1 to sheet 2 dave Excel Worksheet Functions 1 December 5th 09 02:00 AM
Can I annotate a formula result in Sheet 1 in Sheet 2 by Cell Addr Rebecca Bauer Excel Worksheet Functions 2 August 27th 07 07:20 PM
create a formula in one sheet that would read data from separate sheet automatically QD Excel Discussion (Misc queries) 0 December 8th 06 04:17 AM
how to copy a cell with formula from sheet 1 (data is all vertical) into sheet 2 parag Excel Worksheet Functions 3 June 15th 06 10:29 PM
Lookup cell contents in on sheet based on a formula in second sheet Michael Wright via OfficeKB.com Excel Worksheet Functions 1 April 30th 05 04:11 PM


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