Hi i have below code which delete the rows when it finds particular single criteria from multiple sheets i want to modify the code with multiple criteria
Sub DeleteRow_IMPLEMENTATION()
Dim Header As Range
Dim FoundCell As Range
Dim ws As Worksheet
Dim HeaderToFind As String
Dim ValueToFind As String
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
HeaderToFind = "BankName"
ValueToFind = "abcd"
For Each ws In Worksheets
Set Header = ws.Rows(1).Find(what:=HeaderToFind, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True)
If Not Header Is Nothing Then
Set FoundCell = ws.Columns(Header.Column).Find(what:=ValueToFind, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True)
Do While Not FoundCell Is Nothing
ws.Rows(FoundCell.Row).delete
Set FoundCell = Nothing
Set FoundCell = ws.Columns(Header.Column).Find(what:=ValueToFind, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True)
Loop
End If
Next ws
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
End Sub
i tried something like below
HeaderToFind = "BankName"
ValueToFind = "abcd,xyz "
when i tried its not working any help is appreciated.