Eh, immaginavo che le due colorazioni avrebbero potuto andare in conflitto.
Se, invece di colorare, vuoi solo selezionare la riga, modifica come segue:
- Codice: Seleziona tutto
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Warr, StRange As String, tVal
Dim i As Long, j As Long
'
Application.EnableEvents = False
If Not Application.Intersect(Target.Cells(1, 1), Me.UsedRange) Is Nothing Then
Application.Intersect(Target.Cells(1, 1).EntireRow, Me.UsedRange).Select
' Me.UsedRange.Interior.Color = xlNone
' Application.Intersect(Target.Cells(1, 1).EntireRow, Me.UsedRange).Interior.Color = RGB(255, 255, 0)
End If
If Not Application.Intersect(Target.Cells(1, 1), Range("Colora")) Is Nothing Then
tVal = Target.Cells(1, 1)
Warr = Range("C11:G200").Value
For i = 1 To UBound(Warr)
For j = 1 To UBound(Warr, 2)
If Warr(i, j) = tVal Then
StRange = StRange & "," & Range("C11").Cells(i, j).Address
End If
Next j
Next i
If Len(StRange) > 3 Then
Me.Range(Mid(StRange, 2)).Interior.Color = Range("H1").Interior.Color
End If
End If
Application.EnableEvents = True
End Sub
Oltre a cambiare Colora con Seleziona ho aggiunto in testa e in coda Application.EnableEvents = False / True
Riprova...