Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro to copy a value multiple times depending on value in adj | Excel Worksheet Functions | |||
Need To save a spreadsheet multiple times through a macro | Excel Programming | |||
Can you code a macro so it runs multiple times in the same workboo | Excel Discussion (Misc queries) | |||
Run macro multiple times | Excel Programming | |||
Detect Macro Completion | Excel Programming |