+ Reply to Thread
Results 1 to 6 of 6

Remove specific text from all Sheet names

  1. #1
    Registered User
    Join Date
    05-18-2011
    Location
    Hillsboro, OR
    MS-Off Ver
    Excel 2003
    Posts
    6

    Remove specific text from all Sheet names

    After testing out some code to compile a directory of workbooks into one master workbook, creating a separate sheet for each original file, the Sheet Names all have a ".xls" in them, which I realize is due to the filename of the original file. However, I don't need this suffix and would like to run a quick script to clean off the ends since I have quite a few sheets now.

    Anyone have a nugget o' wisdom? Thankee

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Remove specific text from all Sheet names

    Replace All: ".xls" with "". That is, replace all the .xls suffices with nothing

    No script needed.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-18-2011
    Location
    Hillsboro, OR
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Remove specific text from all Sheet names

    Thanks TM but Replace doesn't seem to be looking in the sheet names. I need to know how to edit all the sheets to remove .xls.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Remove specific text from all Sheet names

    Please post a sample of the data in a workbook.

    Regards

  5. #5
    Registered User
    Join Date
    05-18-2011
    Location
    Hillsboro, OR
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Remove specific text from all Sheet names

    Well, I'm not sure how the data in the workbook is relevant as I just need to change the name of the sheet. The sheets all refer to the previous file names of .xls files with names like "CP-1DC.xls" and CP-1EH3.xls". I just want to remove the ".xls" from the worksheet's name tab. There are over 100 tabs and I don't want to edit each one by hand.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Remove specific text from all Sheet names

    The reason for asking for a sample workbook is to make it easier to visualise the problem. If you'd provided a sample workbook with your original post you might have got a definitive answer by return. As it is, it's taken a while longer. ;-)

    However, one possible solution:

    Please Login or Register  to view this content.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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