I have an Excel worksheet where I want to clear cell data if multiple matches are found within a range.
Example image
If matches are found like SUP or AL then clear the content and color the cell corresponding to the match found (e.g SUP - yellow, AL - Red). I have used Below code it is not working.
Dim l As Long, lRow As Long
With Sheets("Sheet1")
lRow = .Range("A" & Rows.Count).End(xlUp).Row
For l = 1 To lRow
For Each c In Range("A:AE")
If c.Value = "SUP" Then
c.Value = ""
End If
Next l
End With
Give this a try:
Edit1: Added looping through all worksheets and the non-case sensitive search. Not tested, but should give you idea on how to do it.
This one should work