How to Automate Display of Pictures Using Comments with VBA
HTML-код
- Опубликовано: 8 окт 2024
- We can automate the display of pictures using comments with VBA in Microsoft Excel. The display of pictures automatically can be useful in a variety of situations.
The code is given below:
Sub showPic()
For Each cell In Selection
MyPicture = "C:\Users\takyar\Pictures\PillowCases\" & cell.Value & ".jpg"
With cell.AddComment
.Shape.Fill.UserPicture MyPicture
End With
Next cell
End Sub
Details at this link:
www.exceltraini...
I have immense respect for you, one of the best, Thank you Guru Takyar
I found it very useful. Have been searching for it for a long time. I have so many places where I wanted to use it. Thank you.
Glad it was helpful! Please share with your friends too.
Excellent sir👍👍👍👍👍
Very useful, Thank you so much!
Glad you found this useful. Please share with your friends also.
Thanks.. Your code is useful.
Glad to hear that. Please share the VBA tutorials with your friends too.
Very useful, thanks a lot.
Hi Dinesh, thank you for your great videos. Can I just ask please - when I run this for a larger selection of say 200 cells, my screen goes unresponsive until all the pictures are added, which takes a fair while. Is there any way to avoid this or is it that my laptop is just too slow? Thank you
I should have said that I'm getting the .jpg from the actual cell instead of from a file but wouldn't have thought this would make any difference. Thank you :)
Hi, Mr.Dinesh
If we need specific size of picture in insert comment. Please kindly advice me. Thank you in advance.
Please try below, for me it worksSub showPic()For Each cell In SelectionMyPicture = "C:\Users\your address\" & cell.Value & ".jpg"With cell.AddComment.Shape.Fill.UserPicture MyPicture
.Shape.ScaleWidth 5.87, msoFalse, msoScaleFromTopLeft
.Shape.ScaleHeight 2.26, msoFalse, msoScaleFromTopLeft
End WithNext cellEnd Sub
Hi, I found this very interesting, but a question can you make a search list for and can you make the pictures bigger? Can you help me?
You can change the size of the comment shape like so:
.Shape.ScaleHeight 3.50, msoFalse, msoScaleFromTopLeft
.Shape.ScaleWidth 7.87, msoFalse, msoScaleFromTopLeft
But will it stay there if I decided to filter and search for a particular item? I don't think so
Hi Mr. Dinesh, It would very appreciated if you could help me in my problem, on the sheet1 of a checklist item 1 in one particular cell which i use to type the picture number from 1 upto 8 picture depend on the item which required. like 2 picture, 4 or 5 or 8 max. same also in item 2, item 3 upto 100 item or row. which required picture. on the sheet 2 the picture should display in a certain range of cell in 12 raw and 8 column just like a rectangle. for 1st item, 2nd, 3rd up to 100. When you click the command bottom, all the picture will be display.
if 1 picture- selected the size of picture is ex. 250x300
if 2 picture- selected the size is ex. 150x250 x2
if 3 picture-selected the size is ex. 100x100 x3
up to 8 picture.
I hope you could help me to program this in command botton.
Is it possible to have the comments appear on the left side of the cell that contains the comment? My comment column is all the way to the right making the comments appear offscreen
You'll have to use the relevant APIs.
How to search data and pictures in an Excel seat using multiple search boxes. Same as Student ID card but multiple simultaneously.
This link will help: ruclips.net/video/_mdtxRm__V0/видео.html
how to put this code in userfarm button and particuler sheet2
There is an error called...
Run time error (some integers written)
and then there is "The specified File wasn't found"
Can you please help
You don't have the file or the path is incorrect!
I WANT EMPLOYEE PHOTO IN SEPARATE COLUMN
CAN U HELP ME OUT
How to link comment cell other cell
How would you use this idea?
How would you use the idea.តើអ្នកនឹងប្រើគំនិតនេះយ៉ាងដូចម្តេច។it
@@Exceltrainingvideos . So I don't know how to do it?