I have the following code that works well except that in the case where there is nothing to paste, the code stops on the "Paste" option so I added "On Error Resume Next".
Now the macro is crashing if it finds the exception. Is it on my last line? Is there something besides "On Error GoTo 0"?
On Error Resume Next
Range("A7:CI26").Select
Selection.Copy
Application.CutCopyMode = False
ActiveSheet.UnProtect Password:="zxc"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.Copy
With ActiveSheet.Previous
.Activate
.Range("A50").Select
.Pictures.Paste
End With
Range("A1").Select
With ActiveSheet.Next
.Delete
End With
closedBook.Close SaveChanges:=False
Range("A1").Select
ActiveWindow.ScrollRow = 1
On Error GoTo 0
Next i