Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = Not Cancel
Select Case Target.Address
Case "$A$3": If Not Target.Comment Is Nothing Then AfficherMasquerLigne5
Case "$E$2"
Columns("F:F").Hidden = Not Columns("F:F").Hidden
Case "$G$1"
UsfChoix.Show 0
Case Else
End Select
If Not Intersect(Range("D3"), Target) Is Nothing Then
Cancel = True
TbCoul = Array(3, 5, 5, 5)
Tb = Array("", "SP 95", "SP 98")
'X = UCase(Trim(Target)) 'Pour mettre en Majuscule
X = (Trim(Target))
If UBound(Filter(Tb, X)) >= 0 Then
Indice = Application.Match(X, Tb, 0) Mod (1 + UBound(Tb))
Target = Tb(Indice)
Couleur = TbCoul(Indice)
If Couleur = 0 Then
Couleur = Target.Offset(0, -1).Interior.ColorIndex
End If
Target.Interior.ColorIndex = Couleur
Else
Target = ""
End If
ElseIf Not Intersect(Range("D2", "D4:D5"), Target) Is Nothing Then
Cancel = True
TbCoul = Array(3, 5)
Tb = Array("", "toto")
'X = UCase(Trim(Target)) 'Pour mettre en Majuscule
X = (Trim(Target))
If UBound(Filter(Tb, X)) >= 0 Then
Indice = Application.Match(X, Tb, 0) Mod (1 + UBound(Tb))
Target = Tb(Indice)
Couleur = TbCoul(Indice)
If Couleur = 0 Then
Couleur = Target.Offset(0, -1).Interior.ColorIndex
End If
Target.Interior.ColorIndex = Couleur
Else
Target = ""
End If
End If
End Sub