Bonjour,
Voyez ce fichier,
Edit de Nad : suppression du lien ; il pointe sur un site et non sur un fichier
Comment faire pour qu'en commentaire il y ait une image?
Code :
Sub CommentImages()
repertoire = ThisWorkbook.Path & "\"
For Each c In Range("B2", [B65000].End(xlUp))
c.ClearComments
c.AddComment
c.Comment.Text Text:=CStr(c)
fichier = CStr(c.Value) & ".jpg"
If Dir(repertoire & fichier) <> "" Then
c.Comment.Shape.Fill.UserPicture repertoire & fichier
taille = TaillePixelsImage(repertoire, fichier)
c.Comment.Shape.Height = Val(Split(taille, "x")(1))
c.Comment.Shape.Width = Val(Split(taille, "x")(0))
c.Comment.Shape.ScaleHeight 0.5, msoFalse, msoScaleFromTopLeft
c.Comment.Shape.ScaleWidth 0.5, msoFalse, msoScaleFromTopLeft
End If
Next
End Sub
Merci par avance.