miming1986
New Member
Code:
Sub NewPage()
Sheets("Master").Visible = True
Sheets("Master").Copy After:=Worksheets(Worksheets.Count)
NewPageName = Format(Date, "mmdd")
ActiveWindow.ActiveSheet.Name = NewPageName
Sheets("Master").Visible = False
Range("B3").Select
End Sub
This code will copy my MASTER sheet, rename it to today's date in "mmdd" format and places it after the last sheet.
What if I run the macro a second, or third time etc. on the same day, since there can't be 2 sheets with the same name in a workbook, i am considering adding 1 day from today's date (if possible excluding weekends - Saturday and Sunday). If this is not doable, i'm thinking of having a msgbox if the macro is run again on the same day to display something like "you're too early for tomorrow's shift".
Last edited: