Hi All,
I apologise in advance for asking help on what looks like a very common question. I have scrolled through various solutions to this question and just don't seem to be able to get a very simple code which I would understand as a beginner to work. I think it has a lot to do with the fact I don't understand how to name a range, and the fact that I don't understand what most of the code means, and therefore have had some interesting results when I have copied code over.
So here's the deal - I have a table in excel where column D has numeric values from 0 and greater and would like to delete the rows that contain 0. The data is refreshed each month, therefore the number of rows this table has will vary, so I can't just say D2:D200 for example.
This is the latest code I tried. My computer has thought about it for ages and eventually just froze.
Thanks
Application.ScreenUpdating = False
Do
Range("D2").Select
If ActiveCell.Value = "0" Then
ActiveCell.EntireRow.Delete Shift:=xlShiftUp
ElseIf ActiveCell.Value <> "0" Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsNull(ActiveCell.Value) Or ActiveCell.Value = 0
Application.ScreenUpdating = True
Bookmarks