Forum Discussion

DuyTan's avatar
DuyTan
Copper Contributor
Sep 22, 2021

Please, I want to display image for column with content URL in excel.

I want to display image for column with content URL Hope the helping. thanks a lot.

5 Replies

  • It required VBA for that. Also a frame to show the image.
    One sugestion is using cell comments as frame. So when the user hover the mouse an image is shown.

     

    Considering cell B2 with the image path you can type on C2 the following UDF

    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

     

     

     

    • Juliano-Petrukio's avatar
      Juliano-Petrukio
      Bronze Contributor
      If it worked, please hit the like button and flag the post as solved.
      • DuyTan's avatar
        DuyTan
        Copper Contributor
        Good Idea
        but i want the image to be in the cell, do you have a better solution?

Resources