Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim n As Byte
Dim Start As Variant
Dim i As Integer
'---- Afficher un commentaire
If Not Intersect(Target, Range("C76")) Is Nothing Then
'Sheets("feuil3").Unprotect
If Range("c76") <> Range("c86") + Range("c102") Then
If Not (Range("c76").Comment Is Nothing) Then Range("c76").ClearComments
MsgBox "message test"
Range("C76").AddComment ' <--- ça bug a ce niveau ???
Range("c76").Comment.Visible = True 'False
Range("c76").Comment.Text Text:="La distance de SAR vers SDR est differente de la somme de deux distances SAR_PJ et PJ-SDR"
Else
Range("c76").ClearComments
End If
'Sheets("feuil3").Protect
End If
'--- faire clignoter la cellule du commentaire
If [C76] <> 0 And [C86] <> 0 And [C102] <> 0 Then
If Not [C76] = [C86] + [C102] Then
Const Texte As String = ""
For i = 1 To 3
Cells(76, 3).Font.ColorIndex = 2
Cells(76, 3).Interior.ColorIndex = 3
For n = 1 To 10
Start = Timer
Do While Timer < Start + 2 / 100
Loop
If n Mod 5 = 0 Then
Cells(76, 3).Interior.ColorIndex = xlNone
Cells(76, 3).Font.ColorIndex = 1
End If
Next n
Next i
End If
End If
'----- Autre commandes
If [H16] <> 1 Then
CommandButton8.Visible = False
Else
CommandButton8.Visible = True
End If
If [H30] <> 1 Then
CommandButton9.Visible = False
Else
CommandButton9.Visible = True
End If
If [H48] <> 1 Then
CommandButton10.Visible = False
Else
CommandButton10.Visible = True
End If
If [H388] <> 1 Then
CommandButton11.Visible = False
Else
CommandButton11.Visible = True
End If
If [C10] = "Technique" Or [C10] = "" Then Range("E10,G10,I10") = ""
If [C24] = "Technique" Or [C24] = "" Then [E24] = ""
If [C42] = "Site Technique" Then [F42] = ""
If [C72] = "" Or [C72] <> "Autre" Then [F72] = ""
If [C318] = "" Or [C318] = "Non" Then [E318] = ""
If [C322] = "" Or [C322] = "Non" Then [F322] = ""
If [C326] = "" Or [C326] = "Non" Then [E326] = ""
If [C334] = "" Or [C334] <> "Autre" Then [F334] = ""
If [C342] = "" Then [E342] = ""
If [C360] = "" Or [C360] <> "Autre ( à définir )" Then [F360] = ""
If [C398] = "" Or [C398] <> "Autre" Then [E398] = ""
If [F402] = "" Or [F402] <> "Autre" Then [I402] = ""
If [F404] = "" Or [F404] <> "Autre" Then [I404] = ""
If [F406] = "" Or [F406] <> "Autre" Then [I406] = ""
If [F408] = "" Or [F408] <> "Autre" Then [I408] = ""
If [F410] = "" Or [F410] <> "Autre" Then [I410] = ""
End Sub