Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I remove extra blank lines in a column when I print? Nancy Excel Discussion (Misc queries) 1 June 7th 07 06:18 PM
Macro not recognizing blank lines as blank pm Excel Discussion (Misc queries) 9 May 22nd 07 04:16 PM
Remove blank lines between records dan Excel Discussion (Misc queries) 1 November 20th 06 09:15 PM
remove blank lines from an entire spreadsheet mdeanda Excel Worksheet Functions 2 April 21st 05 01:53 PM
how to automatically insert blank lines in between non-blank lines No Name Excel Programming 2 November 17th 03 03:40 PM


All times are GMT +1. The time now is 07:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"