Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code to do 3 things, when i ran the macro it deleted
just the one thing, then i pressed run again then it did the other thing! it seemed i had to press run 3 times before the macro executed everything. cant the macro do them all at once or with just one click? thanks alot. Sub Delete_Rows() Dim rng As Range, cell As Range, del As Range Set rng = Intersect(Range("I:I"), ActiveSheet.UsedRange) For Each cell In rng If (cell.Text) = "Covansys" _ Or (cell.Text) = "AMS" _ Or (cell.Text) = "Apollo" Then If del Is Nothing Then Set del = cell Else: Set del = Union(del, cell) End If End If Next cell On Error Resume Next del.EntireRow.delete End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro deletes row in range, macro then skips the row moved up | Excel Discussion (Misc queries) | |||
Macro that deletes every third row....+ | Excel Discussion (Misc queries) | |||
Macro that deletes certain rows only | Excel Programming | |||
is it possible to change this macro to save each sheet seperately? | Excel Programming | |||
Macro that adds then deletes | Excel Programming |