delete rows with 0 values

G

Guest

how can i create a macro that select column O, delete every row that contains
empty cells, cells with 0 values, and non-numeric cells such as --------.
thanks
 
J

Jean-Yves

Sub test
dim rng as range

For each rng in Range("O2", Range("O2").End(xlDown))
If rng.value = "0" or rng.value= "---------"Then rng.clear
Next
columns("O:O").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End sub
Regards
Jean-Yves
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top