Private Sub Worksheet_BeforeDoubleClick(ByVal zz As Range, Cancel As Boolean)
On Error GoTo fin
If zz.Column < 4 Or zz.Column > 100 Then
Application.StatusBar = ""
Exit Sub
End If
If zz.Row < 12 Or zz.Row > 31 Then
Application.StatusBar = ""
Exit Sub
End If
x = zz.Value
If zz.Value = "" Then
Application.StatusBar = ""
zz.ClearComments: Exit Sub
End If
Z = "Nom : " & Cells(zz.Row, 3) & vbLf
v1 = Len(Z)
Z = Z + "Date : " & Cells(11, zz.Column) & vbLf
v2 = Len(Z)
Z = Z + "Horaire initiale : " & zz.Value
With zz
.ClearComments
.AddComment
.NoteText Z
.Comment.Shape.TextFrame.AutoSize = True
End With
With ActiveCell.Comment.Shape.OLEFormat.Object
With .Characters(1, 6).Font
.Bold = True
.ColorIndex = 1
End With
With .Characters(v1, 7).Font
.Bold = True
.ColorIndex = 1
End With
With .Characters(v2, 19).Font
.Bold = True
.ColorIndex = 1
End With
End With
fin:
End Sub