I have the following code which is giving me a " Method'Range' of object'_Global failed" error. It fails on the line with the first instance of Range("A:O" & i)
The purpose of this macro is to search thru column "L". If a cell is empty, cut the data in my Range("A:O"), paste the data at the end of the data field, delete the row, and so on.
Any help would be appreciated! I love this site!
The purpose of this macro is to search thru column "L". If a cell is empty, cut the data in my Range("A:O"), paste the data at the end of the data field, delete the row, and so on.
Any help would be appreciated! I love this site!
Code:
Dim i As Long
Dim LastRow As Long
Dim LR As Long
Sheets("DK").Activate
LastRow = Cells(Rows.Count, "C").End(xlUp).Row
LR = LastRow + 5
For i = 3 To LastRow
If Range("L" & i).Value = ("") Then
Range("A:O" & i).Cut Destination:=Range("A" & LR)
Range("A:O" & i).EntireRow.Delete
Range("A" & LR).Select
Range("A" & LR).PasteSpecial xlPasteAll
LR = LR + 1
End If
Next i
Range("A" & LastRow + 4).Value = "Parts not able to be processed."
Range("A" & LastRow + 4).HorizontalAlignment = xlLeft