ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Row (https://www.excelbanter.com/excel-programming/294625-delete-row.html)

Blue

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



Frank Kabel

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



Ron de Bruin

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





Blue

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




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

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