View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Remove Blank Lines

Sub DeleteZeros()
Dim rw as Long, i as Long, rng as Range
set rw = cells(row.count,"AQ").end(xlup)
for i = rw to 1 step -1
set rng = cells(i,"AQ")
if rng < "" then
if rng.Text = "0" then
rng.EntireRow.delete
end if
end if
Next
End Sub


--
Regards,
Tom Ogilvy


"Nigel" wrote in message
...
I have a spreadsheet where I am comparing 2 cells, the result is placed in
Cell AQ, if the value in that cell is 0, I would like the row to be

deleted,

How would I achieve this

Thanks