isnoend2001
asked on
Macro not woking
Not very familiar with excel 2000
First time i used this macro it worked on another worksheet, but not this one
Public Sub RemoveRows()
Dim SearchString As String
Dim i As Long
SearchString = "Authorization"
i = 1
Do While i <= ThisWorkbook.ActiveSheet.R ange("A1") .CurrentRe gion.Rows. Count
Debug.Print ThisWorkbook.ActiveSheet.C ells(i, 3).Text
If InStr(1, ThisWorkbook.ActiveSheet.C ells(i, 3).Text, SearchString, vbTextCompare) > 0 Then
ThisWorkbook.ActiveSheet.C ells(i, 1).EntireRow.Delete
Else
i = i + 1
End If
Loop
Debug giving these results
33
39
free
44
35
trying to remove row if 3rd column contains the string "Authorization"
what is the problem ?
First time i used this macro it worked on another worksheet, but not this one
Public Sub RemoveRows()
Dim SearchString As String
Dim i As Long
SearchString = "Authorization"
i = 1
Do While i <= ThisWorkbook.ActiveSheet.R
Debug.Print ThisWorkbook.ActiveSheet.C
If InStr(1, ThisWorkbook.ActiveSheet.C
ThisWorkbook.ActiveSheet.C
Else
i = i + 1
End If
Loop
Debug giving these results
33
39
free
44
35
trying to remove row if 3rd column contains the string "Authorization"
what is the problem ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To stop the flickering put
Application.ScreenUpdating = False at the start of the code and Application.ScreenUpdating = True at the end.
In any case you're welcome and I'm glad I was able to help.
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
Application.ScreenUpdating
In any case you're welcome and I'm glad I was able to help.
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
ASKER