Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheet Name
I am trying to make a function that collects the name of a
sheet, and automatically fill in a cell on that sheet with the name. I'm trying something like: Public Function Name() As String On Error GoTo Skip Back: For x = 1 To 35 Name = Sheets(Sheet & x).Name Next x Skip: x = x + 1 GoTo Back End Function Any help would be appreciated. Thanks, John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheet Name
I assume this will be used in a worksheet
Public Function MyName() Application.Volatile MyName = Application.Caller.Parent.Name End Function It will only update when a calculation is performed. -- Regards, Tom Ogilvy John Viall wrote in message ... I am trying to make a function that collects the name of a sheet, and automatically fill in a cell on that sheet with the name. I'm trying something like: Public Function Name() As String On Error GoTo Skip Back: For x = 1 To 35 Name = Sheets(Sheet & x).Name Next x Skip: x = x + 1 GoTo Back End Function Any help would be appreciated. Thanks, John |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheet Name
Hi John:
Try: Public Function SheetName() As String SheetName = Application.Caller.Parent.Name End Function Regards, Vasant. "John Viall" wrote in message ... I am trying to make a function that collects the name of a sheet, and automatically fill in a cell on that sheet with the name. I'm trying something like: Public Function Name() As String On Error GoTo Skip Back: For x = 1 To 35 Name = Sheets(Sheet & x).Name Next x Skip: x = x + 1 GoTo Back End Function Any help would be appreciated. Thanks, John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel sheet bootom half sheet goes behind top part of sheet | Excel Worksheet Functions | |||
Duplicate sheet, autonumber sheet, record data on another sheet | Excel Worksheet Functions | |||
"='sheet 1'!D4" auto fill sheet to sheet ='sheet 2'!D4 | Excel Worksheet Functions | |||
How do I select price from sheet.b where sheet.a part no = sheet.b | Excel Worksheet Functions | |||
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. | Excel Discussion (Misc queries) |