sdfreed
Materials
- Oct 26, 2003
- 6
I created a new worksheet with the current date in a macro. With the recorder I cut and pasted data into the new sheets. But the next day when the date changes, the macro doesn't work because it identifies with the worksheet name on the date recorded
The code for the date is:
Dim a As Worksheet
On Error Resume Next
Set a = Sheets([text(today(),"mm-dd-yyyy"
])
If Err.Number = 0 Then Exit Sub
Application.ScreenUpdating = False
Set a = ActiveWorkbook.Worksheets.Add(after:=Sheets(Sheets.Count))
a.Name = [text(today(),"mm-dd-yyyy"
] & " Quotes"
Application.ScreenUpdating = True
Set a = Nothing
And when it is running the macro is uses:
Range("A1:L11"
.Select
Selection.Copy
Sheets("10-29-2003 Quotes"
.Select
ActiveSheet.Paste
I tried changing: Sheets("10-29-2003 Quotes"
.Select
To: Sheets(a).Select But that did not want to take it.
Is this something right in front of me that I can't see???
Thanks in advance
The code for the date is:
Dim a As Worksheet
On Error Resume Next
Set a = Sheets([text(today(),"mm-dd-yyyy"
If Err.Number = 0 Then Exit Sub
Application.ScreenUpdating = False
Set a = ActiveWorkbook.Worksheets.Add(after:=Sheets(Sheets.Count))
a.Name = [text(today(),"mm-dd-yyyy"
Application.ScreenUpdating = True
Set a = Nothing
And when it is running the macro is uses:
Range("A1:L11"
Selection.Copy
Sheets("10-29-2003 Quotes"
ActiveSheet.Paste
I tried changing: Sheets("10-29-2003 Quotes"
To: Sheets(a).Select But that did not want to take it.
Is this something right in front of me that I can't see???
Thanks in advance