E
Ed Davis
Can someone tell me why this is getting a debug error.
It does what it is supposed to do but it stops with the debug error on the
following line:
sh.cut
Sub CopySheet1andRename()
With Range("B1")
myname = Format(Day(.Value), "00") & "-" & _
Format(Month(.Value), "00") & "-" & Right(.Value, 2)
End With
Sheets("Daily").Copy After:=Sheets(Sheets.Count)
With ActiveSheet
..Name = myname
'removes formulas
..UsedRange.Value = .UsedRange.Value
For Each sh In .Shapes
sh.Cut
Next sh
End With
It does what it is supposed to do but it stops with the debug error on the
following line:
sh.cut
Sub CopySheet1andRename()
With Range("B1")
myname = Format(Day(.Value), "00") & "-" & _
Format(Month(.Value), "00") & "-" & Right(.Value, 2)
End With
Sheets("Daily").Copy After:=Sheets(Sheets.Count)
With ActiveSheet
..Name = myname
'removes formulas
..UsedRange.Value = .UsedRange.Value
For Each sh In .Shapes
sh.Cut
Next sh
End With