Alt+F11 a zvolíš list, zde zkopíruj
Private Sub Worksheet_SelectionChange(ByVal Tg As Range)
Range(Cells(1, 1), Cells(20, 20)).Interior.ColorIndex = xlNone
If Tg.Row < 20 And Tg.Column < 20 Then
Range(Cells(Tg.Row, 1), Cells(Tg.Row, Tg.Column)).Interior.ColorIndex = 34
Range(Cells(1, Tg.Column), Cells(Tg.Row, Tg.Column)).Interior.ColorIndex = 34
Cells(Tg.Row, Tg.Column).Interior.ColorIndex = 6
'varianta 2
'Range(Cells(Tg.Row, 1), Cells(Tg.Row, 20)).Interior.ColorIndex = 34
'Range(Cells(1, Tg.Column), Cells(20, Tg.Column)).Interior.ColorIndex = 34
'Cells(Tg.Row, Tg.Column).Interior.ColorIndex = 6
End If
End Sub
S pozdravem citovat