Ajouter un Double Click cellule F2

Bonsoir le forum

J'arrive à faire fonctionner le Double Click cellule A2 (AfficherMasquerJoursFeries)

Je voudrais ajouter la même chose mais cellule F2 (AfficherMasquerPeriodicite)

Dans la macro ci-dessous

Merci pour vos éventuels retours

Cordialement

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

  If Target.Address = "$A$2" And Target.Count = 1 Then
    AfficherMasquerJoursFeries

    Range("A1").Select
    Exit Sub
    End If

      InitRISTABIL  'Module posologie
  If Target.Column = 1 Then Target.Value = Date: Cancel = True
  If Not Intersect(Range("C3:C" & Range("A" & Rows.Count).End(xlUp).Row), Target) Is Nothing Then
    Cancel = True
    If Range("A" & Target.Row) = "" Then
      MsgBox "Afficher la Date Colonne A"
      Exit Sub
    End If

    Target = IIf(Target = "RISTABIL", "", "RISTABIL")
  ElseIf Not Intersect(Range("B3:B" & Range("A" & Rows.Count).End(xlUp).Row), Target) Is Nothing Then
    Cancel = True
    Target = IIf(Target = Posologie, "", Posologie)  ' modifié le 19/10/2017
  End If
End Sub

Bonjour

Sans ton fichier, il est malaisé de te proposer quelque chose...

Bye !

Bonjour gmb

J'ai fait ça et ça fonctionne mais s'il y a mieux à faire je suis preneur.

Merci et cordialement à toi

Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

  If Target.Address = "$A$2" And Target.Count = 1 Then
    AfficherMasquerJoursFeries
       End If
       Range("A1").Select
       If Target.Address = "$F$2" And Target.Count = 1 Then
    AfficherMasquerPeriodicite
    Range("A1").Select

      InitRISTABIL  'Module posologie
  If Target.Column = 1 Then Target.Value = Date: Cancel = True
  If Not Intersect(Range("C3:C" & Range("A" & Rows.Count).End(xlUp).Row), Target) Is Nothing Then
    Cancel = True
    If Range("A" & Target.Row) = "" Then
      MsgBox "Afficher la Date Colonne A"
      Exit Sub
    End If

    Target = IIf(Target = "RISTABIL", "", "RISTABIL")
  ElseIf Not Intersect(Range("B3:B" & Range("A" & Rows.Count).End(xlUp).Row), Target) Is Nothing Then
    Cancel = True
    Target = IIf(Target = Posologie, "", Posologie)  ' modifié le 19/10/2017
 End If
  End If
End Sub

Bonjour le forum

Je croyais avoir "triomphé" Hélas non

je voudrais faire un double click cellule A2 pour Masquer AfficherMasquerJoursFeries (colonnes IJ)

je voudrais faire un double click cellule F2 pour Masquer fficherMasquerPeriodicite (colonnes GH)

Merci à vous

Toutes mes excuses

Cordialement

7toto.zip (37.05 Ko)

Bonjour,

Si j'ai bien compris ta demande ...

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address = "$A$2" Then Application.Run ("AfficherMasquerJoursFeries")
If Target.Address = "$F$2" Then Application.Run ("AfficherMasquerPeriodicite")
Cancel = True
End Sub
10toto.zip (30.86 Ko)

Bonjour James007

Oui c'est ça sauf qu'il ne faut pas mettre en commentaire la partie que tu as mise elle sert. Suis l'explication sur la page.

Je le fais

Merci à toi

9toto.zip (37.72 Ko)

Bonjour James007

Oui c'est ça sauf qu'il ne faut pas mettre en commentaire la partie que tu as mise elle sert. Suis l'explication sur la page.

Je le fais

Merci à toi

Re,

Je n'ai pas analysé tes instructions existantes ... mais tu ne devrais avoir aucun mal à les ré-intégrer ...

Rechercher des sujets similaires à "ajouter double click"