LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Find/Delete skipping rows

Hello:

Not sure how to resolve this. I'm running this bit of code to delete
rows that contain a 0 value if the Registration Fee is Not Applicable.

It works for the most part, but where it misses rows is when there are
two (or more) consecutive rows with a 0 value. I know this is because
the next "MyCell" becomes the current once the row has been deleted.
Can anyone help resolve this?

Thank you!

Steven


Set FoundCell = SrcHdrRng.Find(What:="Registration Fee")
For Each MyCell In Range(FoundCell.Address, Cells(SrcLast,
FoundCell.Column).Address)
If MyCell.Value = "NotApplicable" Then
If MyCell.Offset(0, 1).Value = 0 Then
MyCell.EntireRow.Delete
End If
End If
Next
 
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
find and delete rows macro clayton ledford Excel Discussion (Misc queries) 4 January 20th 09 03:34 PM
Find and delete all other rows Murray Excel Discussion (Misc queries) 1 August 7th 07 02:54 AM
Find & Delete Rows Steve Wallis Excel Programming 2 June 17th 05 07:06 AM
find and delete rows sulie[_2_] Excel Programming 2 June 7th 05 09:47 AM
Find according to sheet 2, Delete rows in COL A Rubix³ Excel Programming 3 June 24th 04 12:12 AM


All times are GMT +1. The time now is 09:31 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"