LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Macro must run multiple times before completion

With my reply below you may want to add the the below in or else you may get
sick watching it.

After Sub Delete() add Application.ScreenUpdating = False
After Next add Application.ScreenUpdating = True

dustinbrearton wrote:
The problem is when you delete the row it moves the below row up one and then
goes to the next row. The below code does what you are looking for just try
it.

Sub Delete()

Dim strCheck As String
Dim iLastRow As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row

For c = 1 To iLastRow
strCheck = Range("G" & c).Value
If strCheck = "FUNDED" Or strCheck = "DOCS-OUT" Or strCheck = "PURCHASED"
Then
Rows(c).Select
Selection.Delete
c = c - 1
End If
Next

End Sub

I am trying to run a macro that will delete row if a certain keyword is
spotted, but I have to run the macro multiple times before it cleans out the

[quoted text clipped - 13 lines]
Next
End Sub


--
Message posted via http://www.officekb.com

 
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 copy a value multiple times depending on value in adj dribler2 Excel Worksheet Functions 0 January 10th 07 12:48 AM
Need To save a spreadsheet multiple times through a macro mibsaweiss Excel Programming 2 April 19th 06 03:09 PM
Can you code a macro so it runs multiple times in the same workboo dpmac Excel Discussion (Misc queries) 2 April 18th 06 07:40 PM
Run macro multiple times kriemer Excel Programming 0 November 11th 05 03:40 AM
Detect Macro Completion Minilek Excel Programming 3 July 30th 04 06:35 AM


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