Why does my macro stop?
My macro accomplishes exactly what I want it to do but I have to run it twice.
The first time I run it. It stops after selecting the range E6:E300. So, then I have to run it again and it will delete all the rows correctly for me. How can I make it run all the way thru?
My macro accomplishes exactly what I want it to do but I have to run it twice.
The first time I run it. It stops after selecting the range E6:E300. So, then I have to run it again and it will delete all the rows correctly for me. How can I make it run all the way thru?
Code:
Sub Delete_X()
Application.ScreenUpdating = False
Dim c As Range
For Each c In Selection
Range("E6:E300").Select
If c.Value = Range("$IT$1").Value Then c.EntireRow.Delete
Next
Application.ScreenUpdating = True
End Sub