View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] transferxxx@gmail.com is offline
external usenet poster
 
Posts: 31
Default Add file name to end of all sheet name

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