Hi,
I have a VB code which is run from a worksheet called "Marco" this code duplicates the "Template" worksheet and re-names it in DDMM format.
The active cell appears on the newly created sheet. I would like the VB to return to the "Macro" worksheet to complete the 2nd Stage. Can anyone advise what needs to be tweaked with the below code?
Sub AddSheets_Today()
' Add and name a sheet with today's date
Dim szToday As String
' Date Stamp:
szToday = Format(Date, "DDMM")
On Error GoTo MakeSheet
' Check if sheet already exists:
' if it does, select activate it
Sheets(szToday).Activate
' No errors, we are done
Exit Sub
MakeSheet:
' If the sheet doesn't exist:
' Add it
' Name it
Worksheets("Template").Copy After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = szToday
End Sub
Bookmarks