where there is text "Sale" in Col b on sheet1, I want to copy the items from Col A : Col D and paste on sheet
I have tried to write code to do this, it cannot get a run time error "Method of range of object_Global failed"
this part is highlighted when getting the run time error
Range(Cells(i, 1).Cells(i, 4)).Copy
See full code below
Sub mySales()
Dim LastRow As Integer, i As Integer, erow As Integer
LastRow = Sheets(1).Range("B" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow
If Cells(i, 2) Like "*Sale*" Then
Range(Cells(i, 1).Cells(i, 4)).Copy
Sheets("Vehicle Sales Value").Range("A1").PasteSpecial Paste:=xlPasteValues
End If
Next i
End Sub
Bookmarks