In this sheet, I am trying to search in a range for empty cells, and deleting their respective rows.
Sub Delete()
'Amass row numbers
Dim B, Blank As Range
Dim Deletion() As Long
Dim D As Long
Set Blank = Sheets("Quotation").Range("I17:I3816")
D = 0
For Each B In Blank
If IsEmpty(B) Then
D = D + 1
ReDim Preserve Deletion(D)
Deletion(D) = B.Row
End If
Next B
Dim Amass As Range
'A starting point for the Amass range - should it need one pre-Union?
Set Amass = Sheets("Quotation").Range("10000:10000")
'Amass rows
For i = 1 To D
Set Amass = Union(Amass, Sheets("Quotation").Range(Deletion(i) & ":" & Deletion(i)))
Next i
'Delete rows
Amass.EntireRow.Delete
End Sub
It fails on the last action, with the error:
"Delete method of the range class failed"
Am I using the array and "ReDim Preserve" correctly?