#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Delete Row

Hi

I want to delete any row that has 0 in column O starting at row 4 and
continuing to the end of column O, at the moment column O is 3600 rows but
this will increase.

Thanks in advance

Blue


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Delete Row

Hi
try the following macro
Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
Application.ScreenUpdating = False
LastRow = ActiveSheet.Cells(Rows.Count, "O").End(xlUp).row
For RowNdx = LastRow To 4 Step -1
with Cells(RowNdx, "O")
if .value = 0 then
Rows(RowNdx).Delete
End If
end with
Next RowNdx
Application.ScreenUpdating = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany


Blue wrote:
Hi

I want to delete any row that has 0 in column O starting at row 4 and
continuing to the end of column O, at the moment column O is 3600
rows but this will increase.

Thanks in advance

Blue


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete Row

Hi Blue

Try one of the examples on this page
http://www.rondebruin.nl/delete.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Blue" wrote in message ...
Hi

I want to delete any row that has 0 in column O starting at row 4 and
continuing to the end of column O, at the moment column O is 3600 rows but
this will increase.

Thanks in advance

Blue




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Delete Row

Wow that was quick.

Thanks Frank that worked great, Ron will have a look at your site.

Have another query but will start another post.

Thanks Blue


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
delete the test values, but do not delete the formulas kathy Excel Discussion (Misc queries) 1 February 21st 07 07:03 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM


All times are GMT +1. The time now is 09:38 AM.

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"