.
This code works here :
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
Application.EnableEvents = False
Call Test2(Target)
Application.EnableEvents = True
End Sub
Sub Test2(Target As Range)
Dim R As Range, arr, a
Dim cel As Variant
Set R = Range("Q:U").SpecialCells(2)
For Each cel In R
If cel.Interior.ColorIndex = 6 Then
cel.Interior.ColorIndex = xlNone
End If
Next
Set R = Nothing
Set R = Range("H:L").SpecialCells(2)
For Each cel In R
If cel.Interior.ColorIndex = 6 Then
cel.Interior.ColorIndex = xlNone
End If
Next
'Range("Q:U").Interior.ColorIndex = xlNone
arr = Split(Target, "-")
For Each a In arr
Call DoFind(R, a)
Next
End Sub
Sub DoFind(R, v)
Dim c, firstAddress
Dim Target As Range
With R
Set c = .Find(v, Lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
If c.Interior.ColorIndex = xlNone Then c.Interior.ColorIndex = 6
If c.Interior.ColorIndex = 6 Then
If c.Offset(0, 9).Interior.ColorIndex = xlNone Then
c.Offset(0, 9).Interior.ColorIndex = 6
End If
End If
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
Keep in mind, in my version of the workbook, both tables H:L & Q:U start on the same row ( #5 ) and end on the same row ( #27 ). With the code seen above, the tables will need to remain in those locations OR
the code will need to be changed.