Open multiple pictures with 1 userform?

lpking2005

Board Regular
Joined
Mar 21, 2011
Messages
140
I currently have a spreadsheet with about 15 command buttons,
i want each button to open a picture.

Is there a way to have a single userform with just a image box on it, pull the different pictures, depending on which button was pressed?
Instead of creating a userform for each picture.

I was going to use simple IF and ELSE statements on the userform initialize routine, but im still learning and didnt know how to tell it to recognise which button i pressed on the sheet. :(

Any help would be much appreciated.
 
Apologies, slight error in the code.
The first line should read:-
UserForm1.Picture = LoadPicture("*******")

where ****** is the path and filename of the picture
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,225,156
Messages
6,183,228
Members
453,152
Latest member
ChrisMd

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