Hi everyone,
This has been posted before, however, this has a slight twist on it. I am trying to set up a VBA macro so when I click on the "Save" button it copies the current excel sheet and saves it as a date.
I don't want it to save as a completely new excel file, I want it to save as a new excel worksheet inside the same file.
I believe I am close but can't seem to figure out why it won't work.
This has been posted before, however, this has a slight twist on it. I am trying to set up a VBA macro so when I click on the "Save" button it copies the current excel sheet and saves it as a date.
I don't want it to save as a completely new excel file, I want it to save as a new excel worksheet inside the same file.
I believe I am close but can't seem to figure out why it won't work.
Code:
Sub Button1_Click()
Dim dt As String
dt = Format(Now(), "DD-MM-YYYY")
Set wb = ThisWorkbook
ThisWorkbook.Activate
ActiveSheet.Copy After:=wb.dt
wb.Activate
MsgBox "Saved as " + dt
End Sub