View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
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.