Requirement:
The user has a form where the user should see a pic when selecting the name (att. pic).
The catch is that these pics need to be in the sheet itself because this file is moving around. The user knows that it is possible to copy the image in a picture to an image control, but it's complex and it involves using the windows API. Is there any easier solution using image controls instead of?
https://www.ozgrid.com/forum/forum/help-forums/excel-vba-macros/1209394-how-to-populate-image-control-from-pics-in-the-sheet
Solution:
The basic code is just:
Me.Pics.Picture = Sheets("sheet name").imagecontrolname.picture
If you have named the image controls using the same names as are in the combobox, you could use:
Me.Pics.Picture = Sheets("sheet name").OLEObjects(cboMember.Value).Object.picture
Obtained from the OzGrid Help Forum.
Solution provided by rory.
See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets
See also:
How to use VBA code to get image dimensions of inserted images |
How to create a macro that copies all of the tables and charts on a sheet and pastes them as an image on to another sheet |
How to populate image control from pics in the sheet |
How to use VBA code to get image dimensions of inserted images |
Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.