View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Add file name to end of all sheet name

Maybe it's not the hyphen causing the trouble.

A worksheet name is limited to 31 characters and some characters cannot be used.

So what's the original name of the worksheet and what's the name of the
workbook?

wrote:

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


--

Dave Peterson