Check for dated sheet
I tried the code that Bob gave me and it still errors on a
second macro run. "Run-time error '1004' Cannot rename a
sheet to the same name as another sheet". It adds the
sheet just fine the first time, but if I rerun the macro
it croaks when the sheet name has already been created.
Sub blank1()
Dim oWs As Worksheet
On Error Resume Next
Set oWs = Sheets("Blank")
On Error GoTo 0
If Not oWs Is Nothing Then
oWs.Copy Befo=Sheets(1)
ActiveSheet.Name = Format(Date - 1, "mm-dd-yyyy")
End If
End Sub
Mike
|