gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I need this to delete every row where there is not a "B" in column 9 (Column i) Starting in Row 5 down
Code:
Sub DeleteIfNotB()
'Delete Rows that dont have a B in the Type column
Dim LR As Long, j As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
For j = LR To 1 Step -1
If Range("i" & j).Value <> "B" Then Rows(j).Delete
Next j
ActiveSheet.Name = "PBOM"
End Sub
Last edited: