View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
jeremy nickels jeremy nickels is offline
external usenet poster
 
Posts: 13
Default macro to change tab name to file name

Thanks.

How do I keep the tab name from becoming "somefilename.xls"? I need to
leave the .xls off so that the tab name becomes just "somefilename".



"JW" wrote:

Like Bob said, if Filename is a variable holding the filename, then it
works fine.
Filename=ActiveWorkbook.Name
Sheets("compiled").Name = Filename
or
Sheets("compiled").Name = ActiveWorkbook.Name

jeremy nickels wrote:
I need a macro to change the name of a tab to the name of the Excel file.

Here's what I've got (the original name of the tab is "compliled"). It
doesn't work:

Sheets("compiled").Select
Sheets("compiled").Name = Filename

Thanks