1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
With Union(Range("QuestionnaireA1"), Range("QuestionnaireA2"), Range("QuestionnaireA31"), Range("QuestionnaireA32"))
.Interior.ThemeColor = xlThemeColorDark1
.Font.ColorIndex = xlAutomatic
End With
If Not Intersect(Target, Range("QuestionnaireA1")) Is Nothing Then
With Range(Cells(Target.Row, 1), Cells(Target.Row, 2))
.Interior.Color = Range("TitreA1").Interior.Color
.Font.Color = Range("TitreA1").Font.Color
End With
End If
If Not Intersect(Target, Range("QuestionnaireA2")) Is Nothing Then
With Range(Cells(Target.Row, 1), Cells(Target.Row, 2))
.Interior.Color = Range("TitreA2").Interior.Color
.Font.Color = Range("TitreA2").Font.Color
End With
End If
If Not Intersect(Target, Range("QuestionnaireA31")) Is Nothing Then
With Range(Cells(Target.Row, 1), Cells(Target.Row, 2))
.Interior.Color = Range("TitreA31").Interior.Color
.Font.Color = Range("TitreA31").Font.Color
End With
End If
If Not Intersect(Target, Range("QuestionnaireA32")) Is Nothing Then
With Range(Cells(Target.Row, 1), Cells(Target.Row, 2))
.Interior.Color = Range("TitreA32").Interior.Color
.Font.Color = Range("TitreA32").Font.Color
End With
End If
End Sub |
Partager