View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.newusers
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Adding a loop to conditional delete code

You should note that if you have consecutive cells with a value greater than 16, the second cell's
row will not be deleted using this method.

The prefered step through method is to start at the bottom and work up.

For myRow = 10000 to 2 Step - 1
If Cells(myRow,6).Value = 16 Then Cells(myRow,6).EntireRow.Delete
Next myRow

Still slower than sorting first, but it will get all the values, unlike the first method.

HTH,
Bernie
MS Excel MVP


"maw via OfficeKB.com" <u12713@uwe wrote in message news:64ce9464e110e@uwe...
Thanks Steve,

I did make that little amendment to yours and it works fine :-)

Thanks again guys

Mark

--
www familyfund org uk

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200608/1