Clic droit en G seulement doit afficher un nouveau commentaire

Bonjour,

Voici le code :

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
With Target
    If .Column >= 7 Then
     If .Column <= 7 Then
        Cancel = True
        If .Comment Is Nothing Then
            .AddComment
            .Comment.Shape.Width = 104.5
            .Comment.Shape.Height = 150.6
            .Comment.Shape.TextFrame.Characters.Font.Bold = True
        End If
        SendKeys "%im"
    End If
End With
Cancel = True
End Sub

Là le code n'est pas valable.

N'y a t il pas moyen de mettre en G ?

Merci

Cordialement

Bonjour PyranaS9, le forum,

Peut-être ainsi:

If .Column >= 7 Then
     If .Column <= 7 Then

revient à dire

 If .Column = 7 Then

non ?

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
  With Target
    If .Column = 7 Then
        Cancel = True
        If .Comment Is Nothing Then
            .AddComment
            .Comment.Shape.Width = 104.5
            .Comment.Shape.Height = 150.6
            .Comment.Shape.TextFrame.Characters.Font.Bold = True
        End If
            SendKeys "%im"
    End If
  End With
       Cancel = True
End Sub

Cordialement,

PS: Le clic droit est-il judicieux ? Comment fais-tu si tu souhaites supprimer le commentaire?

Bonjour PyranaS9, le forum,

Peut-être ainsi:

If .Column >= 7 Then
     If .Column <= 7 Then

revient à dire

 If .Column = 7 Then

non ?

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
  With Target
    If .Column = 7 Then
        Cancel = True
        If .Comment Is Nothing Then
            .AddComment
            .Comment.Shape.Width = 104.5
            .Comment.Shape.Height = 150.6
            .Comment.Shape.TextFrame.Characters.Font.Bold = True
        End If
            SendKeys "%im"
    End If
  End With
       Cancel = True
End Sub

Cordialement,

PS: Le clic droit est-il judicieux ? Comment fais-tu si tu souhaites supprimer le commentaire?

Oui c'est vrai ça semble logique. Merci beaucoup.

Re,

Oui c'est vrai ça semble logique. Merci beaucoup.

Vraiment effrayant ton avatar,

Pourquoi tant de haine ?

Spoiler
peluche piranha 18 cm ref plush15875

Bonne soirée,

Re,

Oui c'est vrai ça semble logique. Merci beaucoup.

Vraiment effrayant ton avatar,

Pourquoi tant de haine ?

Spoiler

peluche-piranha-18-cm-ref-plush15875.jpg

Bonne soirée,

Ce n'est pas de la haine, ça m'est venu à une époque. Je ne devais pas être bien disposé. Mais ça passe. Je me soigne.

Du coup, j'ai gardé cet avatar.

Rechercher des sujets similaires à "clic droit seulement doit afficher nouveau commentaire"