Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Clic en dehors du tableau pour effacer les lignes coloriées
Range("A20:H" & Range("H65535").End(xlUp).Row).Interior.Pattern = xlNone
'Pour la partie désignation
If Not Intersect(Target, Range("Surligneur")) Is Nothing And Target.Count = 1 Then
Range(Cells(Target.Row, 1), Cells(Target.Row, 8)).Interior.Color = RGB(255, 192, 0)
End If
If Not Intersect(Target, Range("Surligneur")) Is Nothing And Target.Count = 4 Then
Range(Cells(Target.Row, 1), Cells(Target.Row, 8)).Interior.Color = RGB(255, 192, 0)
If Len(Cells(Target.Row, 3)) > 60 Then
Cells(Target.Row, 3).RowHeight = 30
Else
Cells(Target.Row, 3).RowHeight = 15
End If
End If
If Not Intersect(Target, Range("Surligneur")) Is Nothing And Target.Count = 1 Then
Range(Cells(Target.Row, 1), Cells(Target.Row, 8)).Interior.Color = RGB(255, 192, 0)
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Or annul = 1 Then annul = 0: Exit Sub
'Mettre en majuscule des cellules
If Target.Address = "$G$14" Then annul = 1: Cells(14, 7) = StrConv(Cells(14, 7), 1): Exit Sub
'Mettre en majuscule la première lettre
If Not Intersect(Target, Range("NomPropre")) Is Nothing Then annul = 1: Target = UCase(Left(Target, 1)) & Mid(Target, 2): Exit Sub
annul = 0
End Sub