• 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

Logit

Active Member
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

Top