+ Reply to Thread
Results 1 to 12 of 12

Macro to rename sheet tabs

  1. #1
    Registered User
    Join Date
    02-20-2008
    Posts
    22

    Macro to rename sheet tabs

    Hello,

    I have 31 sheets plus one summary sheet. I want to rename the 31 sheets using a macro for the days of the depend on the Month. I have not got anywhere with it. I have tried having the summary sheet's, column from A1:A31 with the days of the month and renaming the sheets from that. Then just manually entering A1 every month with the first day of the month. Also I really do not need or want weekends but for simplicity I have left them in the workbook. When I run the Macro below it will not take the date I used different date formats but does not change things "Thursday, July 01, 2010" If I put Text in it runs fine.

    Any help please

    Sub RenameTabs()
    ' Renames all worksheet tabs with each worksheet's cell A1 contents.
    'If cell A1 has no content, then that tab is not renamed.

    For i = 1 To Sheets.Count
    If Worksheets(i).Range("A1").Value <> "" Then
    Sheets(i).Name = Worksheets(i).Range("A1").Value
    End If
    Next

    End Sub
    Last edited by kithing; 07-05-2010 at 02:52 PM. Reason: [SOLVED]

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to rename sheet tabs

    CODE tags, please.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    02-20-2008
    Posts
    22

    Re: Macro to rename sheet tabs

    Hello,

    I have 31 sheets plus one summary sheet. I want to rename the 31 sheets using a macro for the days of the depend on the Month. I have not got anywhere with it. I have tried having the summary sheet's, column from A1:A31 with the days of the month and renaming the sheets from that. Then just manually entering A1 every month with the first day of the month. Also I really do not need or want weekends but for simplicity I have left them in the workbook. When I run the Macro below it will not take the date I used different date formats but does not change things "Thursday, July 01, 2010" If I put Text in it runs fine.

    Any help please

    Please Login or Register  to view this content.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to rename sheet tabs

    How do you want them named?

  5. #5
    Registered User
    Join Date
    02-20-2008
    Posts
    22

    Re: Macro to rename sheet tabs

    ideally I woulds like the namedby the days of the week and date. Like "Mon 7-1-10" or something simialiar.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to rename sheet tabs

    Maybe like this:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-20-2008
    Posts
    22

    Re: Macro to rename sheet tabs

    This worked great Thanks I will put this as solved One more question can you do the same but exclude all saturdays and sundays

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to rename sheet tabs

    Take a look again at the tab names.

  9. #9
    Registered User
    Join Date
    02-20-2008
    Posts
    22

    Re: Macro to rename sheet tabs

    I am blind thank you very much.

  10. #10
    Registered User
    Join Date
    02-20-2008
    Posts
    22

    Smile [SOLVED] Macro to rename sheet tabs

    the issue is resolved

  11. #11
    Registered User
    Join Date
    08-31-2012
    Location
    denver
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Macro to rename sheet tabs

    Is there anyway to apply this macros for future months?

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to rename sheet tabs

    eflynn,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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