cjvenables
Board Regular
- Joined
- Aug 2, 2011
- Messages
- 65
Hello,
I'm trying to search each cell in column C and see if contains OPEN, CLOSED, or PROCESSED. If they do not contain any 1 of those 3 words, I want to delete the entire row.
I have been unsuccessful with my code so far, hopefully you guys can provide some guidance.
Thanks so much,
I'm trying to search each cell in column C and see if contains OPEN, CLOSED, or PROCESSED. If they do not contain any 1 of those 3 words, I want to delete the entire row.
I have been unsuccessful with my code so far, hopefully you guys can provide some guidance.
Thanks so much,
Code:
Sub Delete()
Application.ScreenUpdating = False
Dim rng As Range
Dim colwords As Variant
colwords = Array("OPEN", "CLOSED", "PROCESSED")
For Each rng In Range("C2:C" & Range("A" & Rows.Count).End(xlUp).Row)
If rng.Value <> colwords Then EntireRow.Delete
Next rng
Application.ScreenUpdating = True
MsgBox "Your Macro is Complete!", vbOKOnly, "Macro Status"
End Sub