Cravengame
New Member
- Joined
- May 8, 2018
- Messages
- 3
I'm not sure what I'm doing wrong when entering this code, but I did use it before and I'm not sure what I did the last time. Basically what i'm trying to do is to copy a range of columns and paste them into another set of columns. When I type the macro the error comes up for the first line.
Private Sub CommandButton11_Click()
Sheets("NEW VENDOR SUMMARY").Range("Z3:Z866").Delete (<- this line is yellow)
Sheets("NEW VENDOR SUMMARY").Range("M3:M").Copy
Sheets("NEW VENDOR SUMMARY").Range("Z3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("L3:L").Copy
Sheets("NEW VENDOR SUMMARY").Range("M3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("K3:K").Copy
Sheets("NEW VENDOR SUMMARY").Range("L3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("J3:J").Copy
Sheets("NEW VENDOR SUMMARY").Range("K3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("I3:I").Copy
Sheets("NEW VENDOR SUMMARY").Range("J3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("H3:H").Copy
Sheets("NEW VENDOR SUMMARY").Range("I3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("G3:G").Copy
Sheets("NEW VENDOR SUMMARY").Range("H3").PasteSpecial (xlPasteValues)
MsgBox "Data Updated"
End Sub
Private Sub CommandButton11_Click()
Sheets("NEW VENDOR SUMMARY").Range("Z3:Z866").Delete (<- this line is yellow)
Sheets("NEW VENDOR SUMMARY").Range("M3:M").Copy
Sheets("NEW VENDOR SUMMARY").Range("Z3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("L3:L").Copy
Sheets("NEW VENDOR SUMMARY").Range("M3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("K3:K").Copy
Sheets("NEW VENDOR SUMMARY").Range("L3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("J3:J").Copy
Sheets("NEW VENDOR SUMMARY").Range("K3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("I3:I").Copy
Sheets("NEW VENDOR SUMMARY").Range("J3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("H3:H").Copy
Sheets("NEW VENDOR SUMMARY").Range("I3").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Sheets("NEW VENDOR SUMMARY").Range("G3:G").Copy
Sheets("NEW VENDOR SUMMARY").Range("H3").PasteSpecial (xlPasteValues)
MsgBox "Data Updated"
End Sub