Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
rows identification and deletion | Excel Discussion (Misc queries) | |||
Automatic Deletion of Rows | New Users to Excel | |||
On deletion of rows | Excel Discussion (Misc queries) | |||
Deletion of rows where a value is satisfied | Excel Worksheet Functions | |||
Deletion of rows according to background color | Excel Programming |