+ Reply to Thread
Results 1 to 8 of 8

Renaming Multiple Worksheets within Workbook

  1. #1
    Registered User
    Join Date
    06-15-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Renaming Multiple Worksheets within Workbook

    I have just taken over a new job at the hospital system I work for to annually inspect the Medical Gas equipment in each patient room of our many hospitals. In recent years different people have been doing them each year, who really didn't care, and the patient rooms and different floors are all out of order on the workbooks, yet the worksheet tab names are counted Patient Outlet Page (1), Patient Outlet Page (2), Patient Outlet Page (3), etc..I had to move the sheets around to put them in their actual order based on floor and patient room number, but now the worksheet names are out of order. Is there a way to rename multiple worksheets(all 87 of them) within an entire workbook?

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Renaming Multiple Worksheets within Workbook

    Sure, what do you want to call them now?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    06-15-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Renaming Multiple Worksheets within Workbook

    I would like them to be:

    Patient Outlet 1, Patient Outlet 2, Patient Outlet 3, etc..all the way to Patient Outlet 87


    there are worksheets before "Patient Outlet 1" that need to stay the same, and there are worksheets after "Patient Outlet 87"


    If it helps, the sheet after "Patient Outlet 87" is called "Patient Outlet Totals" and it lists how many outlets are on each worksheet.

    The names that are in cells A5-A91 are "Patient Outlet 1" through "Patient Outlet 87"
    Last edited by crisbyy; 06-15-2011 at 08:19 AM.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Renaming Multiple Worksheets within Workbook

    This will rename any sheet that's name use to start with Patient Outlet Page to Patient Outlet 1, Patient Outlet 2 etc

    Please Login or Register  to view this content.

    Dom

  5. #5
    Registered User
    Join Date
    06-15-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Renaming Multiple Worksheets within Workbook

    Thanks! I'm sure that works correctly but when I entered it into vba and clicked run, nothing happened.

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Renaming Multiple Worksheets within Workbook

    See the attached example.

    Dom
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-15-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Renaming Multiple Worksheets within Workbook

    Sweet! It worked! I didn't have the Option Explicit code. Anyways, I really appreciate the help and it will save a lot of time in the future!

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Renaming Multiple Worksheets within Workbook

    No worries. Option Explicit isn't actually part of the code but a setting in VBA that forces you to declare variables within your code so shouldn't have made any difference. Not sure why it wouldn't have worked before.

    Dom

+ 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