anthoYS
XLDnaute Barbatruc
Bonjour
Merci :=)
VB:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 1 And Target.Row > 1 Then
Cancel = True
Ligne = Target.Row 'ou Application.Goto [repas].Columns(1).Find(Date)
UserForm1.Show
End If
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 2 Then ' Vérifie si le clic droit est dans la colonne B
Cancel = True ' Annule le menu contextuel par défaut
'Masque les commentaires
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
' Crée ou ouvre une nouvelle note
If Target.Comment Is Nothing Then
Range("A1").Copy
With Target
.PasteSpecial Paste:=xlPasteComments
.Comment.Visible = True
.Comment.Shape.Select
End With
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Masque les commentaires
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End Sub
Merci :=)