Sheet Name Formula

  • Thread starter Thread starter art
  • Start date Start date
A

art

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.
 
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
 
Thanks, this is exactly what I needed. It's much easier to use then using the
Filename.... Formula.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top