Sub ListeCommentaires()
mafeuille = ActiveSheet.Name
Application.DisplayAlerts = False
On Error Resume Next
Sheets("TempNoms").Delete
On Error GoTo 0
Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = "TempNoms"
Set champ = Range("B3:B10")
ligne = 2
For Each c In Sheets(mafeuille).Comments
If Not Intersect(Range(c.Parent.Address), champ) Is Nothing Then
Sheets("TempNoms").Cells(ligne, 1) = c.Parent.Address
Sheets("TempNoms").Cells(ligne, 2) = Right(c.Text, Len(c.Text) - 8)
ligne = ligne + 1
End If
Next c
End Sub
Sub Commentaire()
If ActiveCell.Comment Is Nothing Then
ActiveCell.AddComment ' Création commentaire
ActiveCell.Comment.Shape.OLEFormat.Object.Font.Name = "Arial"
ActiveCell.Comment.Shape.OLEFormat.Object.Font.Size = 9
ActiveCell.Comment.Shape.OLEFormat.Object.Font.FontStyle = "Normal"
SendKeys "+{F2}"
End If
End Sub
Alt+F11, Insertion, module, copiez le code.bonjour,
Super! seulement je m'y connais pas en VBA. je peux appliquer cette solution comment?
merci encore une fois.
Malheureusement, il y a un souci avec la macro, elle ne fonctionne pas
Function ExtComm$(x As Range)
Dim t, n&, i&
Application.Volatile
If Not x.Comment Is Nothing Then
t = Split(x.Comment.Text, vbLf)
If InStr(t(0), ":") > 0 Then n = 1 Else n = 0
For i = 0 To UBound(t) - 1
t(i) = Trim$(t(i + n))
Next i
ReDim Preserve t(0 To UBound(t) - n)
ExtComm = Trim$(Join(t, ""))
End If
End Function