Hello,
Thought this would be simple but apparently it's not
I am trying to write a code that deletes all rows that does not have a value of "CANCELLED" in column W. The range starts from rows 5 until last row that has data.
This is what i have so far....
Sub DeleteRows()
Dim rcell as Long
Dim RC_LR As Long
RC_LR = Range("A" & Rows.Count).End(xlUp).row
For rcell = 5 To RC_LR
If Not Range("W" & rcell).Value = "ORDER CANCELLED" Then
With Rows(rcell & ":" & rcell)
.EntireRow.delete
End With
End If
Next rcell
End Sub
Bookmarks