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: 50
Default Macro does not delete all the required rows

Hi Everyone,

I have a datasheet (a daily report that I get from a system). In this
report I have column AE that contains the identifier for that row.
Some of the identifiers are DUMMY. These are wrong postings from the
system. I have written a following code to delete all rows that have
DUMMY in column AE.

Sub delete_dummy()
Dim Cell As Range
For each Cell in Range("AE:AE")
If Cell.Value = "DUMMY" Then
Cell.EntireRow.Delete
End If
Next Cell
End Sub

The code works but it does not delete all the rows containing dummy. I
have to run it a few times before all the dummy rows are deleted. I
have no idea why that happens and how to fix it so that all the dummy
items are deleted in one go. Can someone help me with this. Thanks
very much.

Regards,
-AG
 
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
Macro to delete rows Hankjam[_2_] Excel Discussion (Misc queries) 4 October 1st 08 03:58 PM
Can't get Rows to delete in macro Goobies[_7_] Excel Programming 2 February 2nd 06 08:05 AM
Macro to delete rows Melanie Breden Excel Programming 2 May 10th 04 11:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM


All times are GMT +1. The time now is 09:10 AM.

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

About Us

"It's about Microsoft Excel"