(Solved) – Deleting entire range with ActiveCell.Offset

  • by

I have a macro I am developing that pulls data from one sheet to another. This is a very long and complicated macro but I need help with one part.

If myarray(i, Remedy) = "" Then 
    ActiveCell.Offset(1, 0).Value = myarray(i, Remedy - 1)
End IF

The remedy is a column name on sheet 1 that the macro looks at to pull row values from. The possible values in this “remedy” are text values.

What I want to do is to ignore that entire row IF a cell in that column is null.

If myarray(i, Remedy).Value <> " Then
    ActiveCell.Offset(1, 0).Range("A1:D6").Delete
End If

above is what I have so far. Basically in the above code if the cell is blank then (even though it is still going to copy everything from the entire row over), delete that range that is copied to the new sheet. I am using ActiveCell because the quantity of records is different every time.

Leave a Reply

Your email address will not be published. Required fields are marked *