Hi,
I am getting a Type mismatch error of the below italic line. I cannot see where the problem is. Can anyone help (the macro goes down column Y and deletes entire row if cell in column Y is B or is C);
Last = Cells(Rows.Count, "A").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "Y").Value) = "B" Or (Cells(i, "Y").Value) = "C" Then
Cells(i, "A").EntireRow.Delete
End If
Next i
I am getting a Type mismatch error of the below italic line. I cannot see where the problem is. Can anyone help (the macro goes down column Y and deletes entire row if cell in column Y is B or is C);
Last = Cells(Rows.Count, "A").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "Y").Value) = "B" Or (Cells(i, "Y").Value) = "C" Then
Cells(i, "A").EntireRow.Delete
End If
Next i