Share via

Creating sheets with weekly dates

Anonymous
2022-12-24T21:29:35+00:00

I have 52 sheets created and need to date each one with Sundays date for every week in 2023. How can I do this without changing each name individually?

I found several macros that work for creating a daily sheet, but I need to be able to have only Sundays dates.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2022-12-24T22:00:03+00:00

Here is a macro.

Remarks:

  • You can use a different date format of course, but you cannot use / in the format; slashes aren't allowed in worksheet names.
  • Sunday December 31, 2023 is not included since it is the 53rd Sunday in 2023. Sub NameSheets() Dim i As Long Dim d As Date Application.ScreenUpdating = False d = DateSerial(2023, 1, 1) For i = 1 To 52 Worksheets(i).Name = Format(d, "d-mmm-yyyy") d = d + 7 Next i Application.ScreenUpdating = True End Sub

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2022-12-24T22:21:04+00:00

    Worked perfectly. Any minor adjustments needed I have been able to do. Thank you for your quick reply and help.

    Was this answer helpful?

    0 comments No comments