Closed Thread
Results 1 to 2 of 2

Inserting a picture into comment macro

  1. #1
    Registered User
    Join Date
    02-23-2011
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    4

    Inserting a picture into comment macro

    Hi there,

    I have a spreadsheet with 500 values, each with a seperate image. My objective is to have each of these images inserted as comments to their respective values, as having each one physically take up a cell would make the sheet too large to view.

    Inserting these individually would take hours upon hours, so with help I've gotten this far:

    Sub Insert_Comment_Picture()
    Dim PicNo As Double

    For PicNo = 1 To 2
    Range("A" & PicNo).AddComment ("")
    Range("A" & PicNo).Comment.Shape.Fill.UserPicture "C:\My Pictures\" & PicNo & ".jpg"
    Next PicNo

    End Sub

    The problem with this is that it doesn't actually look at any values in cells, it only inserts the pictures in order.

    Basically, I want the macro to look at the values in column E and insert the pics with the same name located in C:\My Pictures\ in column G.

    Help please!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Inserting a picture into comment macro

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1