• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Module to display picture of comment

Kenneth John

New Member
Is it possible to modify the module so that it can view picture from the comment?
For example F5 should be able to display the picture after lookup E5.
 

Attachments

  • Copying-Comments.xlsm
    198.7 KB · Views: 6
I picked this up from Contextures.com . Hopefully it will help.


Code:
Option Explicit
' Developed by Contextures Inc.
' www.contextures.com
Sub InsertComment()
Dim rngList As Range
Dim c As Range
Dim cmt As Comment
Dim strPic As String
    
On Error Resume Next

'change this to the range that contains the file names in your workbook
Set rngList = Range("A1:A5")

'change this to the folder path for your picture files
strPic = "C:\Data\"

If Right(strPic, 1) <> "\" Then
  strPic = strPic & "\"
End If

For Each c In rngList
  With c.Offset(0, 1)
    Set cmt = .Comment
    If cmt Is Nothing Then
      Set cmt = .AddComment
    End If
    With cmt
      .Text Text:=""
      .Shape.Fill.UserPicture strPic & c.Value
      .Visible = False
    End With
  End With
Next c

End Sub
 

Attachments

  • CommentPicCode.zip
    31.6 KB · Views: 4
I am really impressed with your article. The information you share will be an important document for me to learn more about this topic.

Moderator Note: Is there any specific reason - why did You add hidden link there?
 
Last edited by a moderator:
Back
Top