Sub e_DeleteUnwanted()
Dim rg As Range
Dim i As Long, j As Long, n As Long, t As Long
Dim s As String
Application.ScreenUpdating = False
Application.StatusBar = "Deleting Unwanted Rows"
With Sheets("Table")
Set rg = .Range("A2").CurrentRegion
End With
n = rg.Rows.Count
For i = n To 1 Step -1
s = UCase(Left(rg.Cells(i, 1).Value, 4))
If (s = "MGMT") Then
rg.Rows(i).EntireRow.Delete
j = j + 1
End If
Next
With Sheets("Table")
Set rg = .Range("C2").CurrentRegion
End With
n = rg.Rows.Count
For i = n To 1 Step -1
t = IsNumeric(Cells(i, 1))
If (t = "4") Then
rg.Rows(i).EntireRow.Delete
j = j + 1
End If
Next
Application.StatusBar = False
End Sub
test.xlsx
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE