Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to set up a worksheet name as file name
I want worksheet name to be auto change when I change the file name
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to set up a worksheet name as file name
In the ThisWorkbook module:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) ActiveSheet.Name = Me.Name 'refer to your sheet if it's not the active sheet End Sub Sheet names are limited to 31 characters, so you may want to do something like this: If Len(Me.Name) 31 Then ActiveSheet.Name = Left(Right(Me.Name, 35), 31) Cliff Edwards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Worksheet to new file | Excel Discussion (Misc queries) | |||
Worksheet to new file | Excel Discussion (Misc queries) | |||
copy part of a worksheet into a worksheet in the same file/keepi. | Excel Worksheet Functions | |||
Saving worksheet in new file with date AND cell value as file name | Excel Discussion (Misc queries) | |||
How to get file name on a worksheet? | New Users to Excel |