Results 1 to 8 of 8

How to remove "-" from a worksheet?

Threaded View

  1. #1
    Registered User
    Join Date
    09-16-2011
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    52

    Question How to remove "-" from a worksheet?

    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
    Last edited by alexxgalaxy; 01-14-2013 at 06:47 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1