madhuchelliah
Board Regular
- Joined
- Nov 22, 2017
- Messages
- 226
- Office Version
- 2019
- Platform
- Windows
Hey Guys, Please check code below. This code will delete entire row if it find the given word. I want to change this code to give more words criteria instead of one word. So that i no need to repeat the code again and again to delete the rows. Thank you.
Code:
Sub DelWords()
Dim SrchRng As Range, Cel As Range
Set SrchRng = Range("A1:A1000")
For Each Cel In SrchRng
If InStr(1, Cel.Value, "John") > 0 Then
Cel.EntireRow.Delete
End If
Next Cel
End Sub