Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does anybody has a macro which would add the file name of my active
workbook to all sheet name of the workbook eg if file name is file.xls & sheetA & sheetB & sheetC macro will rename sheets as foll: sheetA - file (without extension ".xls") sheetB - file sheetC - file thxs |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub SheetnameANDWorkbook()
ActiveSheet.Name = ActiveSheet.Name & "-" & Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) End Sub can anybody debug above - as I having error with: & "-" & Thxs wrote: Does anybody has a macro which would add the file name of my active workbook to all sheet name of the workbook eg if file name is file.xls & sheetA & sheetB & sheetC macro will rename sheets as foll: sheetA - file (without extension ".xls") sheetB - file sheetC - file thxs |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi TransferXXX,
Try: '============= Public Sub Tester() Dim WB As Workbook Dim SH As Worksheet Dim sStr As String Set WB = ActiveWorkbook sStr = Left(WB.Name, Len(WB.Name) - 4) For Each SH In WB.Worksheets SH.Name = SH.Name & " - " & sStr Next SH End Sub '<<============= --- Regards, Norman wrote in message oups.com... Does anybody has a macro which would add the file name of my active workbook to all sheet name of the workbook eg if file name is file.xls & sheetA & sheetB & sheetC macro will rename sheets as foll: sheetA - file (without extension ".xls") sheetB - file sheetC - file thxs |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thxs work great !!
Norman Jones wrote: Hi TransferXXX, Try: '============= Public Sub Tester() Dim WB As Workbook Dim SH As Worksheet Dim sStr As String Set WB = ActiveWorkbook sStr = Left(WB.Name, Len(WB.Name) - 4) For Each SH In WB.Worksheets SH.Name = SH.Name & " - " & sStr Next SH End Sub '<<============= --- Regards, Norman wrote in message oups.com... Does anybody has a macro which would add the file name of my active workbook to all sheet name of the workbook eg if file name is file.xls & sheetA & sheetB & sheetC macro will rename sheets as foll: sheetA - file (without extension ".xls") sheetB - file sheetC - file thxs |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why does a Multi-sheet/user file open on sheet two every time? | Excel Discussion (Misc queries) | |||
Split text file into Excel sheet and separate the final results intoa new sheet | Excel Worksheet Functions | |||
copy the same raws of all sheets from about a 100 file to a new sheet of a book and save the file | Setting up and Configuration of Excel | |||
Updating excel sheet with selected data from another sheet in the same file | Excel Worksheet Functions | |||
Macro to insert values from a file and save another sheet as a .txt file | Excel Programming |