Column C of my [Event History] sheet is my main data source. Column A of my [Eliminate] sheet has a list of different text.
The following works if the in [Eliminate] A1 is MATCHED in [Event History] Column C.
I need to be able to delete entire rows in [Event History] which CONTAINS any of the words in column A of [Eliminate].
Sub DeleteRowIfValue()
'
Dim LastRowInRange As Long, RowCounter As Long
'
LastRowInRange = Sheets("Event History").Range("C1:C100").Find("*", , xlFormulas, , xlByRows, xlPrevious).Row ' Returns a Row Number
'
For RowCounter = LastRowInRange To 1 Step -1 ' Count Backwards
If Sheets("Event History").Range("C" & RowCounter) = Sheets("Eliminate").Range("A1") Then ' If Cell matches our 'Delete if' value then
Sheets("Event History").Rows(RowCounter).EntireRow.Delete ' Delete the row
End If
Next
End Sub
I've tried using wildcard characters in the [Eliminate] list but this did not work.
The following works if the in [Eliminate] A1 is MATCHED in [Event History] Column C.
I need to be able to delete entire rows in [Event History] which CONTAINS any of the words in column A of [Eliminate].
Sub DeleteRowIfValue()
'
Dim LastRowInRange As Long, RowCounter As Long
'
LastRowInRange = Sheets("Event History").Range("C1:C100").Find("*", , xlFormulas, , xlByRows, xlPrevious).Row ' Returns a Row Number
'
For RowCounter = LastRowInRange To 1 Step -1 ' Count Backwards
If Sheets("Event History").Range("C" & RowCounter) = Sheets("Eliminate").Range("A1") Then ' If Cell matches our 'Delete if' value then
Sheets("Event History").Rows(RowCounter).EntireRow.Delete ' Delete the row
End If
Next
End Sub
I've tried using wildcard characters in the [Eliminate] list but this did not work.