Hello All,
I have searched without success to find code I could adapt to what I want to do.
I want to copy my existing worksheet (named "2014") including the command buttons and the code that goes with them, to a new worksheet (named "2015") and so on every year.
And I would like this to happen automatically on December 28 each year.
I believe this is possible. But I am not versed enough in Excel to accomplish it. (so far)
Here is some code I have been playing with. I know it is far from what I really need.
I have it attached to a command button for quick testing...
Any help would be greatly appreciated.
Thanx in advance
D-Dog
I have searched without success to find code I could adapt to what I want to do.
I want to copy my existing worksheet (named "2014") including the command buttons and the code that goes with them, to a new worksheet (named "2015") and so on every year.
And I would like this to happen automatically on December 28 each year.
I believe this is possible. But I am not versed enough in Excel to accomplish it. (so far)
Here is some code I have been playing with. I know it is far from what I really need.
I have it attached to a command button for quick testing...
Code:
Private Sub CommandButton1_Click()
Dim myWorksheet As Worksheet
Dim myWorksheetName As String
myWorksheetName = Format(Now, "yyyy")
For Each myWorksheet In Worksheets
If myWorksheet.Name = myWorksheetName Then
MsgBox "Sheet already exists...Make necessary " & _
"corrections and try again."
Exit Sub
End If
Next myWorksheet
Sheets.Add.Name = myWorksheetName
Sheets(myWorksheetName).Move Before:=Sheets(Sheets.Count)
End Sub
Any help would be greatly appreciated.
Thanx in advance
D-Dog