When I run the following code, I get a Run-time Error '1004': Delete method of Range class failed. If there is nothing in column D, then the if statement is not satisfied and the macro runs fine and doesn't do anything.
Changing the Delete line to 'Rows(i).Delete Shift=x1Up' works just fine, but I would prefer to just delete the selected range.
Here is the entire macro:
This is my first post, so I hope it is done correctly.![]()
Sub AssignRequests() Dim i As Integer i = 2 Do While i <= Range("OutstandingCount") + 10 If Range("D" & i) <> "" Then Range("PasteRange").Value = Range("A" & i, "D" & i).Value Range("A" & i, "D" & i).Delete Shift:=x1Up Else: i = i + 1 End If Loop End Sub
Thanks!
Bookmarks