+ Reply to Thread
Results 1 to 6 of 6

Automatically rename sheets with week and dates

  1. #1
    Registered User
    Join Date
    03-19-2024
    Location
    Rotterdam
    MS-Off Ver
    Office 365
    Posts
    2

    Automatically rename sheets with week and dates

    Good day,

    At work I've created a simple attendance sheet where i have the year and weeknumber in a seperate cells, and then for the different days it calculates the dates.
    For every week there is a different worksheet, but now they're named manually with the weeknumber and start and end dates of that week as follows "Wk# | dd-dd MMM". This would look something like "Wk12 | 18-22 Mrt" for this current week (Mrt, because I'm Dutch). For a week overlapping months, it would then have the shorthand month behind each number like "29 Apr - 3 May" for example
    Is there a piece of code I could use that would automatically rename the sheets like that based on the value in the cells I mentioned earlier?

    Thanks in advance.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Automatically rename sheets with week and dates

    something like:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Automatically rename sheets with week and dates

    Hi there,

    See if the following code does what you need (it renames individual worksheets, but can be easily modified to rename all worksheets if appropriate):

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Automatically rename sheets with week and dates

    Hi again,

    Ok, here's the Bulk-Rename version, and (I hope) the date-crunching mechanics are a bit more straightforward!

    Please Login or Register  to view this content.

    Regards,

    Greg M
    Last edited by Greg M; 03-21-2024 at 04:41 PM. Reason: Corrected version posted

  5. #5
    Registered User
    Join Date
    03-19-2024
    Location
    Rotterdam
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Automatically rename sheets with week and dates

    Quote Originally Posted by Greg M View Post
    Hi again,

    Ok, here's the Bulk-Rename version, and (I hope) the date-crunching mechanics are a bit more straightforward!

    Please Login or Register  to view this content.

    Regards,

    Greg M
    This code works perfectly! Thanks. Got a mismatch error at one point, but solved that.
    Would you also happen to know how to exlude certain worksheets from being renamed?

    Regards,

    Danny

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Automatically rename sheets with week and dates

    Hi again Danny,

    The highlighted additions should do what you need - obviously the sheet names should be altered to suit your requirements:

    Please Login or Register  to view this content.
    Glad to hear that the previous version got things moving in the right direction.

    Regards,

    Greg M

+ 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: 8
    Last Post: 01-09-2024, 11:21 AM
  2. Copy sheet within a workbook and automatically rename it based on dates, for the month
    By albegood4u in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-20-2023, 05:35 AM
  3. Replies: 5
    Last Post: 04-24-2023, 04:28 PM
  4. Rename Sheets Names automatically
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2017, 09:48 AM
  5. Replies: 6
    Last Post: 11-26-2014, 10:30 AM
  6. Auto rename sheets 1-7 with weekdays and dates
    By jimpr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2013, 04:35 AM
  7. Rename Automatically Different Sheets
    By rami10 in forum Excel General
    Replies: 1
    Last Post: 04-25-2013, 11:33 AM

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