I have the following code that could help to remove "-" in the name of all the worksheets in a workbook, except the worksheet "0-Summary". It works well in one workbook but doesn't in the other. The file extension of one of the workbooks is "xls" while the other (the one that the code doesn't work on) is "xlsm". To make the code work on the xlsm workbook, does the code needs changes? If it does, can anyone help with it? Thanks in advance!
Sub DEL_Comma()
Dim s As Variant
Dim MySh As String
MySh = "0-Summary"
For Each s In ThisWorkbook.Sheets
If s.Name <> MySh Then
s.Name = Replace(s.Name, "-", "")
End If
Next
End Sub
Bookmarks