ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove Blank Lines (https://www.excelbanter.com/excel-programming/346734-remove-blank-lines.html)

Nigel

Remove Blank Lines
 
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

Tom Ogilvy

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





All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com