Deletion of rows where a value is satisfied
I have a spreadsheet with 3 colums. Columns are headed Part Number,
Description and Qty. What I would like to do is delete all rows where the qty value is zero. I can't do this using auto filter as I have some small sub headings within the list and want them to stay visible. Any ideas please? Many thanks. Larry. |
Deletion of rows where a value is satisfied
hi,
assuming the the date is in column a,b and c. private sub delrows() dim zo as range set zo = range("c2") do while not isempty(zo) Set zod = zo.offset(1,0) if zo.value = 0 then zo.entirerow.delete set zo = zod else set zo = zod end if loop end sub -----Original Message----- I have a spreadsheet with 3 colums. Columns are headed Part Number, Description and Qty. What I would like to do is delete all rows where the qty value is zero. I can't do this using auto filter as I have some small sub headings within the list and want them to stay visible. Any ideas please? Many thanks. Larry. . |
Deletion of rows where a value is satisfied
Second Attempt:
Sub DD() Dim rng as Range, i as Long set rng = cells(rows.count,3).End(xlup) for i = rng.row to 2 step - 1 if not isempty(cells(i,3)) then if cells(i,3).Value = 0 then cells(i,3).EntireRow.Delete end if end if Next end Sub -- Regards, Tom Ogilvy "Larry Wallis" wrote in message ... I have a spreadsheet with 3 colums. Columns are headed Part Number, Description and Qty. What I would like to do is delete all rows where the qty value is zero. I can't do this using auto filter as I have some small sub headings within the list and want them to stay visible. Any ideas please? Many thanks. Larry. |
All times are GMT +1. The time now is 01:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com