Dazzawm
Well-known Member
- Joined
- Jan 24, 2011
- Messages
- 3,786
- Office Version
- 365
- Platform
- Windows
I am learning code so please look at the code below. It looks for "Front Link Rod" then deletes the row. What if I want to look for other things as well like "Rear Link Rod", do I put a comma like in red, Well I know thats not right because it doesnt work! How do I write it please?
Rich (BB code):
Sub test()
Dim a As Integer
Dim b As Integer
Range("S1").Select
a = ActiveCell.CurrentRegion.Rows.Count
For b = 1 To a
If Selection.Value = "Front Link Rod, Rear Link Rod" Then
Selection.EntireRow.Delete
Else
Selection.Offset(1, 0).Select
End If
Next b
End Sub