try this macro
highlighting is ambiguous and also will go away if you accidentally select some other cell
I have indicated highlighting by a color
Sub test()
Dim x, r As Range, filt As Range, j As Long, k As Long
Worksheets("sheet1").Activate
x = Range("D2").Value
Set r = Range(Range("A3"), Cells(Rows.Count, "M").End(xlUp).Offset(0, 2))
'It would be more convenient if you do not leave blanks cells or rows
'while desining data sheets.
'MsgBox r.Address
r.Cells.Interior.ColorIndex = xlNone
If Range("d2") <> "" Then
r.AutoFilter field:=2, Criteria1:=x
Set filt = r.Offset(1, 0).Resize(r.Rows.Count - 1).SpecialCells(xlCellTypeVisible)
j = filt.Areas.Count
For k = 1 To j
filt.Areas(k).Cells.Interior.ColorIndex = 6
Next k
End If
ActiveSheet.AutoFilterMode = False
End Sub
Bookmarks