Hi,
I have a for loop (provided as an answer to a seperate question), this loop moves through every row with a value in column A.
I now wish to reuse this code in a new way, to remove any rows that contain 110 or 111 within column A. I have drafted the below code but am not really sure how to acheve this, if anyone has any ideas, I would be greatful.
I have a for loop (provided as an answer to a seperate question), this loop moves through every row with a value in column A.
I now wish to reuse this code in a new way, to remove any rows that contain 110 or 111 within column A. I have drafted the below code but am not really sure how to acheve this, if anyone has any ideas, I would be greatful.
Code:
Sub DeleteRowTest()
Dim LR As Long
Dim i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row()
For i = 1 To LR
If Range("i1").Value = "110" Then
MsgBox ("YES")
'Rows("??").Select
'Selection.EntireRow.Delete
ElseIf Range("i1").Value = "111" Then
MsgBox ("YES")
'Rows("??").Select
'Selection.EntireRow.Delete
Else
'Return
End If
Next i
End Sub