I am trying to copy data from multiple sheets one by one and paste them to a different sheet. Here is my code below. However, it shows "Run-time error 1004: Select method of Range class failed".
Private Sub CommandButton1_Click()
'Stop if report not filled in fully
If Range("G28") < "1" Then
MsgBox ("Please Amend Quantity")
End If
If Range("G28") >= "1" Then
Range("B28").Select
Selection.Copy
Sheets("Order List").Range("A1").Offset(1, 0).Select
ActiveSheet.Paste
End If
Sheets("Order List").Columns("A:D").AutoFit
End Sub
The code: "Sheets("Order List").Range("A1").Offset(1,0).Select" is highlighted error. I was trying to let it select the blank column in Line A from A1 under Order List sheet and paste the value from B28 under current sheet to it. Please give me some advice. Many thanks
Range("B28").Copy Sheets("Order List").Range("A1").Offset(1,0)
inside of yourIf Range("G28") >= "1"
if instead of what's in there now. – barvobot