Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Larry Wallis
 
Posts: n/a
Default 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   Report Post  
Jason Morin
 
Posts: n/a
Default

One way. Press ALT+F11, go to Insert Module, and paste
in the code below. Press ALT+Q and run the macro from
Tools Macro. The code below evaluates col. A:

Sub DeleteRow()
'Adapted from Microsoft code found at
'msdn.microsoft.com
Dim sFind As Long
Dim Rng As Range
Dim sFindRow As Long
sFind = 0
Set Rng = Range("A:A").Find(What:=sFind, lookat:=xlWhole)
While Not Rng Is Nothing
sFindRow = Rng.Row
Rng.EntireRow.Delete
Set Rng = Range("A" & sFindRow - 1 & ":A" & _
Rows.Count) _
.Find(What:=sFind, lookat:=xlWhole)
Wend
End Sub

---
Note that this works on 0 values, not formulas returning
the value 0.

HTH
Jason
Atlanta, GA

-----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.
.

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
Insert rows based on specific value bob Excel Worksheet Functions 6 February 29th 08 07:11 PM
flexible paste rows function that inserts the right number of rows marika1981 Excel Discussion (Misc queries) 1 February 18th 05 02:40 AM
Row selections by row # OR by even/odd rows in another spreadsheet Tom Excel Discussion (Misc queries) 0 February 9th 05 04:03 PM
Adding Rows to Master Sheet Excel Newbie New Users to Excel 1 December 23rd 04 10:56 PM
Copying Rows when hiding other rows Neutron1871 Excel Worksheet Functions 2 November 3rd 04 11:38 PM


All times are GMT +1. The time now is 05:23 AM.

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

About Us

"It's about Microsoft Excel"