Forum Discussion

rickcoulter1's avatar
rickcoulter1
Copper Contributor
Sep 07, 2021

Embedded images in Excel that populate when you scroll over the appropriate cell

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

2 Replies

  • rickcoulter1 

    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

     

  • DKoontz's avatar
    DKoontz
    Iron Contributor
    You could actually turn a comment into a picture, that way on hover, it'll display the picture you want to show.

    You can turn a note into a picture by creating a new note > right clicking note > format comment > Colors and Lines > Fill > Color > Picture> upload picture from there.

Resources