With Range("A1")
.Comment.Visible = True
.Comment.Text Text:="C'est qui par Tutatis?!"
.Comment.Shape.TextFrame.AutoSize = True
End With
With Range("A1")
.Comment.Visible = True
.Comment.Text Text:=Replace(.Comment.Text, Application.UserName _
& ":" & Chr(10), "C'est qui Tutatis?!")
.Comment.Shape.TextFrame.AutoSize = True
End With
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
With Range("d5")
.Comment.Visible = True
.Comment.Text Text:=Replace(.Comment.Text, "C'est qui par Tutatis?!", _
"C'est qui Tutatis?!")
.Comment.Shape.TextFrame.AutoSize = True
End With
Cancel = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Range("d5")
.Comment.Visible = True
.Comment.Text Text:="C'est qui par Tutatis?!"
End With
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
With Range("a2")
.AddComment
.Comment.Text Text:=""
.Comment.Shape.Width = 100 ' Largeur
.Comment.Shape.Height = 45 'Hauteur
End With
With Range("e5")
.AddComment
.Comment.Text Text:=""
.Comment.Shape.Width = 80 ' Largeur
.Comment.Shape.Height = 35 'Hauteur
End With
End Sub
Re
Code VBA:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
With Range("a2")
.AddComment
.Comment.Text Text:=""
.Comment.Shape.Width = 100 ' Largeur
.Comment.Shape.Height = 45 'Hauteur
End With
With Range("b5")
.AddComment
.Comment.Text Text:=""
.Comment.Shape.Width = 80 ' Largeur
.Comment.Shape.Height = 35 'Hauteur
End With
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("a2:a100")) Is Nothing Then
With ActiveCell
.AddComment
.Comment.Text Text:=""
.Comment.Shape.Width = 100 ' Largeur
.Comment.Shape.Height = 45 'Hauteur
End With
End If
If Not Intersect(Target, Range("e2:e100")) Is Nothing Then
With ActiveCell
.AddComment
.Comment.Text Text:=""
.Comment.Shape.Width = 80 ' Largeur
.Comment.Shape.Height = 30 'Hauteur
End With
End If
End Sub