Private Sub Worksheet_Change(ByVal Target As Range)
Set Target = Intersect(Target, [A26:A200,F26:G200])
If Target Is Nothing Then Exit Sub
Dim plage As Range, col As Variant
Set plage = Range("M19", Cells(19, Columns.Count).End(xlToLeft))
Set Target = Intersect(Target.EntireRow, [H:H])
For Each Target In Target
Intersect(Target.EntireRow, plage.EntireColumn).ClearComments
col = Application.Match(Target, plage, 0)
If IsNumeric(col) And Target(1, 0) <= Target Then
With Target(1, 5 + col)
.AddComment Cells(Target.Row, 1).Text
.Comment.Shape.TextFrame.AutoSize = True
.Comment.Visible = True
End With
End If
Next
'Valeur en C26:C200
'If Not Target Is Nothing And Target.Count = 1 Then
Select Case Target.Value
Case Is = "P1", "P2"
Target.Offset(, -1).Resize(1, 4).Interior.ColorIndex = 1
Target.Offset(, -1).Resize(1, 4).Font.ColorIndex = 2
Target.Offset(, 2).IndentLevel = 0
Case Is = "S1"
Target.Offset(, 1).Value = "t"
Target.Offset(, 1).Font.Name = "Wingdings"
Target.Offset(, 2).IndentLevel = 1
Target.Offset(, 1).Font.ColorIndex = 5 'Bleu Police Bleu
Target.Offset(, -1).Font.ColorIndex = 2 'Police Blanc
Target.Offset(, -1).Interior.ColorIndex = 5 'Bleu
Case Is = "S2"
Target.Offset(, 1).Value = "t"
Target.Offset(, 1).Font.Name = "Wingdings"
Target.Offset(, 2).IndentLevel = 1
Target.Offset(, 1).Font.ColorIndex = 3 'Rouge
Target.Offset(, -1).Interior.ColorIndex = 5 'Bleu
Case Is = ""
Target.Offset(, -1).Resize(1, 4).Value = ""
Target.Offset(, -1).Resize(1, 4).Interior.ColorIndex = 0 'Blanc
Target.Offset(, -1).Resize(1, 4).Font.ColorIndex = 1 'Rouge
Target.Offset(, 2).IndentLevel = 0
Case Else
'Target.Interior.ColorIndex = 38 ' xlNone
End Select
'End If
End Sub