Ca ne veut pas le faire

Bonjour le forum

J'ai un "trou d'air"!!!

J'ai fait ça il y a quelques années et puis je ne me souviens plus.

Dans cellule A2 ça fonctionne bien mais dans A6 non car j'ai 2 fois ce code dans ma feuille je pense

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  If Target.Count > 1 Then Exit Sub
  If Intersect(Target, [A2:A5]) Is Nothing Then Exit Sub
  If Not Target.Comment Is Nothing Then LignesRegularisationColonnesExplications
End Sub

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  If Target.Count > 1 Then Exit Sub
  If Intersect(Target, [A6]) Is Nothing Then Exit Sub
  If Not Target.Comment Is Nothing Then AfficherMasquerLignes
End Sub

Ma macro est celle-ci:

Sub AfficherMasquerLignes()
ActiveSheet.Unprotect
Range("33:36, 63:66, 93:96, 123:123").EntireRow.Hidden = Not Range("33:36, 63:66, 93:96, 123:123").EntireRow.Hidden   'Sans indexation sur colonne et domaine de cellules
Range("A1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, _
    Scenarios:=True
End Sub

Merci à vous pour vos éventuels retours

Cordialement

Bonjour,

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Target.Count > 1 Then Exit Sub
    If Not Intersect(Target, [A2:A5]) Is Nothing Then
        If Not Target.Comment Is Nothing Then LignesRegularisationColonnesExplications
    ElseIf Not Intersect(Target, [A6]) Is Nothing Then
        If Not Target.Comment Is Nothing Then AfficherMasquerLignes
    End If
End Sub

Bonsoir Steelson

P$$$$N de End if

Encore un GRAND merci à toi

Bonne fin de soirée

Cordialement

Rechercher des sujets similaires à "veut pas"