I have the following macro to delete rows containing text for eg demo/Fleet , fleet cars, New Dept in Col V on sheet "used cars"
eh BR1 Demo/Fleet
BR1 New Dept
Br2 Fleet cars etc
However when running the macro, no rows are being deleted
It would be appreciated if someone can kindly assist me
Possibly I need to use Instr, but not sure how to use this
eh BR1 Demo/Fleet
BR1 New Dept
Br2 Fleet cars etc
However when running the macro, no rows are being deleted
It would be appreciated if someone can kindly assist me
Code:
Sub Delete_Demo()
Sheets("Used Vehicles").Select
Dim LR As Long, I As Long
LR = Cells(Rows.Count, "V").End(xlUp).Row 'last row
For I = LR To 1 Step -1
If Cells(I, "V") Like "*Demo*" Then Rows(I).Delete
If Cells(I, "V") Like "*Fleet*" Then Rows(I).Delete
If Cells(I, "V") like "*New dept*" Then Rows(I).Delete
Next I
End Sub
Possibly I need to use Instr, but not sure how to use this