Help. I recorded the macro and am trying to clean it up but keep running into a problem.
Here is my very clumsy code.
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Sheets("Credit Template").Visible = True
Sheets("Credit Template").Select
Columns("A:n").Select
Range("A2").Activate
Selection.Copy
Sheets("Credit").unprotect
Sheets("Credit").Select
Range("a1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
This code works...ONCE.
If I run it again, it fails with Run-time Error '1004': PasteSpecial Method of Range class failed.
I've tried ActiveSheet.Paste and that doesn't work either.
What am I doing wrong and how does it work once and then not again unless I reset everything?
Here is my very clumsy code.
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Sheets("Credit Template").Visible = True
Sheets("Credit Template").Select
Columns("A:n").Select
Range("A2").Activate
Selection.Copy
Sheets("Credit").unprotect
Sheets("Credit").Select
Range("a1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
This code works...ONCE.
If I run it again, it fails with Run-time Error '1004': PasteSpecial Method of Range class failed.
I've tried ActiveSheet.Paste and that doesn't work either.
What am I doing wrong and how does it work once and then not again unless I reset everything?