Sep 07 2021 09:04 AM
I'm working with a spreadsheet that has multiple images in expanded format. I was hoping to only have the images appear when I scroll over the appropriate cell. Currently, there are too many images on the spreadsheet that are in expanded format. Thanks for your help
Sep 07 2021 10:14 AM
Sep 07 2021 10:26 AM
Considering cell D2 with the image path you can type on E2 the following UDF
=AddCommentWithImage(D2)
Public Function AddCommentWithImage(ByRef ImagePath As String)
Dim rng As Range, cmt As Comment
Set rng = ActiveCell
If Not (rng.Comment Is Nothing) Then rng.Comment.Delete
Set cmt = rng.AddComment
cmt.Text Text:=""
With cmt.Shape
.Fill.UserPicture ImagePath
.Width = 481.5864
.Height = 359.7734
End With
End Function