SQUIDD
Well-known Member
- Joined
- Jan 2, 2009
- Messages
- 2,126
- Office Version
- 2019
- 2016
- Platform
- Windows
Hi All
I want to change my code to just run without activating or selecting the sheet.
Its not a major problem of course, but its just neater.
I have been trying to figure it out, but cannot, so please see code below that works.
It loops the 6 sheets and then goes back to the main sheet(meetings)
your time is appriciated. Dave
I want to change my code to just run without activating or selecting the sheet.
Its not a major problem of course, but its just neater.
I have been trying to figure it out, but cannot, so please see code below that works.
It loops the 6 sheets and then goes back to the main sheet(meetings)
your time is appriciated. Dave
Code:
Sub REMOVE_NON_MATCHING_GRADES()
GRADE = Mid(Range("'MEETINGS'!$H$1"), 7, 1)
For A = 1 To 6
Sheets("TRAP " & A).Select
LR = Range("K" & Rows.Count).End(xlUp).Row
For i = LR To 4 Step -1
If Not Range("k" & i).Value Like GRADE & "*" Then Rows(i).Delete
Next i
Next A
Sheets("MEETINGS").Select
End Sub