bonjour
il faut nous signaler où visual basic t'indique une erreur si tu veux que l'on t'aide.
sinon, voilà un bout de code ci-dessous qui crée une log avec les commentaires
'<http://xlbysteph.free.fr/aideinformatique/actionaide.htm#20>
Sub writeComments()
dim mycomment As Comment, mySht As Worksheet
Open "C:\Test.txt" for Output As #1
for each mySht In worksheets
for each mycomment In worksheets(mySht.name).Comments
Print #1, "From " & mycomment.Parent.Parent.name _ & mycomment.Parent.address _ & " Comes the comment: " _ & mycomment.Text
next mycomment
next mySht
Close #1
end Sub
tu peux y rajouter par exemple l'instruction une condition, ce qui donnerait
If InStr(1, mycomment, "comment") > 0 Then
Print #1, "From " & mycomment.Parent.Parent.Name & mycomment.Parent.Address & " Comes the comment: " & mycomment.Text
End If
'cf aussi <http://xlbysteph.free.f/aideinformatique/actioncellule.htm>