Name worksheet as today's date on open

  • I’m looking to write some code so that when the workbook opens it loops through all the worksheet names looking for one named with today’s date. If it finds one, do nothing. If it doesn’t, I want to find the one with the most recent date, take a copy of it, and rename the new copy of the sheet to today’s date.


    Any ideas? I'm stuck even knowing where to begin


    Also posted here: http://www.mrexcel.com/forum/e…ate-open.html#post4648150

  • Re: Name worksheet as today's date on open


    Code
    On Error Resume Next
    If ThisWorkbook.Sheets("Sheet" & Date).Name <> ("Sheet" & Date) Then
        ThisWorkbook.Sheets.Add.Name = "Sheet" & Date
    End If
    On Error Goto 0

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!