+ Reply to Thread
Results 1 to 6 of 6

Excel Macro to rename workbook tabs does not work

  1. #1
    Registered User
    Join Date
    10-16-2019
    Location
    Cincinnati OH
    MS-Off Ver
    16
    Posts
    3

    Excel Macro to rename workbook tabs does not work

    Hello,

    I work for an online school and supervise 31 teachers. Twice a month, I run a report which gives me the number of hours each teacher has spent online. I output the report in an excel workbook. The output has 31 tabs for each teacher's information. The tabs are Sheet 1, Sheet 2, etc. I recorded a macro renaming each tab with the name of the teacher, so I wouldn't have to type each teacher's name every time I ran the report. Whe I tried to run the macro I got this error message:

    Run-time error '9':

    Subscript out of range

    When I clicked on debug (I cannot debug VBA), I got this:
    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    I don't know how to proceed at this point, or if the macro I need is possible. Any help would be appreciated. Thanks, again.

    Andy
    Last edited by 6StringJazzer; 10-16-2019 at 01:33 PM.

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Excel Macro to rename workbook tabs does not work

    Try this: https://excelribbon.tips.net/T013463..._of_Names.html
    Click the * to say thanks.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Excel Macro to rename workbook tabs does not work

    Did you try to run the macro more than the one time?

    BTW:Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Excel Macro to rename workbook tabs does not work

    Where is the correspondence between sheet number and names ??
    - Battle without fear gives no glory - Just try

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Excel Macro to rename workbook tabs does not work

    Also reported a cross posted.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Excel Macro to rename workbook tabs does not work

    Andy0311, welcome to the forum. Unfortunately you have two rules violations on your very first post. As a new member, your first order of business should be to take the time to review our rules. There aren't many, and they are all important. I already fixed your code tags for you.

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.





    Because a new member cannot post hot links I have done it for you here:

    https://www.mrexcel.com/forum/excel-...o-problem.html
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 02-24-2014, 02:39 PM
  2. copy sheets to new workbook with new name, rename tabs within that workbook
    By Conky4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2012, 04:44 PM
  3. Macro to Rename Tabs
    By Accountant II in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-09-2012, 09:50 AM
  4. Replies: 2
    Last Post: 09-04-2012, 01:19 AM
  5. Macro to rename sheet tabs
    By kithing in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-31-2012, 01:36 PM
  6. REname tabs macro, error
    By fatpiggy123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2010, 12:39 PM
  7. Rename all tabs in workbook
    By DiDi in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-22-2010, 02:10 PM

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