Hello Eonizuka,
Perhaps the following code will meet your needs. Try it in a backup copy of your workbook first, of course.
Sub removeRows()
Dim i As Long
Application.ScreenUpdating = False
For i = Sheets("Sheet1").UsedRange.Rows.Count To 1 Step -1
If Cells(i, "B").Value <> "Group:" And _
Right(Cells(i, "Q").Value, 1) <> "%" Then _
Cells(i, "Q").EntireRow.Delete Shift:=xlUp
Next i
Application.ScreenUpdating = True
End Sub
This code will delete any row in which:
1. Column B of that row does not contain the exact text "Group:"
2. The last character in Column Q of that row is not "%"
Your percentages are currently formatted as text. If they are converted to numbers using the percentage format, this code would need to change since numbers formatted as percent don't actually have a % sign in the value of the cell (it's only shown that way). If your whole number values (non-percents) in column Q will always be greater than 1, you could use that as the conditional test, e.g.
If Cells(i, "B").Value <> "Group:" And _
Cells(i, "Q").Value > 1 Then _
Hope that helps!
Bookmarks