I want to rename my first sheet or tab in excel based on the file name. If I change the file name, I want the first sheet to be automatically renamed. I don't want .xlsx to be included. I tried this macro:
Sub RenameSheet() Dim myname myname = Replace(ActiveWorkbook. Name, ".xls", "") ActiveSheet.Select ActiveSheet.Name = myname Range("A1").Select End Sub
but it's not automatically renamed.