Add image to cell comment box

jpenndcl

New Member
Joined
Aug 14, 2008
Messages
19
I have a set of data with text in one cell and images in a cell adjacent the text to illustrate the text. I am trying to figure out how to add a comment to the cell containing the text and take the image in the adjacent cell and put it in the comment. Is there a way to do this, or do I have to write a macro that saves the images as their own files and then insert the image files into the comment?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
That does help a bit, but I am struggling with modifying the code to select an image that is already in the spreadsheet (I know I can refer to them by name or in order) and fill the comment box with that.

I did find this which might help store a picture in a variable, which I might be able to use with your suggestion to get the desired result ...

http://www.mrexcel.com/archive/VBA/15308.html

I still haven't quite gotten it though
 
Last edited:
Upvote 0
Just curious, why would you want them stored in the workbook AND inserted into a comment box ?? I think your Workbook size is going to explode out of control..

Remember.. Excel stores pictures as BMP's regardless of the original format and as such.. a simple little 20K JPG can balloon to 500K in nothing flat.. and if it's stored in the Book AND the Comment box, that's now 1mb of Picture..
 
Upvote 0
Haven't tested it but you might want to try something like
.Fill.UserPicture me.shape.item[1] or something to that effect..
 
Upvote 0
Just curious, why would you want them stored in the workbook AND inserted into a comment box ?? I think your Workbook size is going to explode out of control..

Remember.. Excel stores pictures as BMP's regardless of the original format and as such.. a simple little 20K JPG can balloon to 500K in nothing flat.. and if it's stored in the Book AND the Comment box, that's now 1mb of Picture..


the pictures and text were given to me this way and I have not separated them out because it would take a lot of extra time and effort, so unfortunately I am stuck with it being this way
 
Upvote 0
Haven't tested it but you might want to try something like
.Fill.UserPicture me.shape.item[1] or something to that effect..


how are you declaring "me" and "item"?

FYI - userpicture wants a string argument, so I am not sure how I can make that work
 
Last edited:
Upvote 0
If you don't have the disk files anywhere, I suspect you may have to copy the pictures to a blank chart, use the Export method of the chart to create the files, then use the Userpicture method with those files.
 
Upvote 0
If you don't have the disk files anywhere, I suspect you may have to copy the pictures to a blank chart, use the Export method of the chart to create the files, then use the Userpicture method with those files.

would it be easier to have the pictures in a word file? Can I use an export function from the word file to create the separate image files, which I can then add in to excel through the userpicture function?
 
Upvote 0
What you could do is save the workbook as a web page. That should create a separate directory with all the images in it. You can then use those with the Userpicture property.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top