Excel Dashboard to Open Pictures from a Folder

LadyScot101

New Member
Joined
Feb 6, 2022
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
Hello All,

I've never made a dashboard before, but I have 1000s of alumni pictures that I want to have the user push a button on an Excel Dashboard to either show all the pictures in a folder, or By Name, By Student ID, By Year, or By Function (such as Football, etc). I have a Command Button for each of those. I just need to code them in VBA. If the user pushes the All Pictures Button, it just opens up all the pictures in the folder. If the users pushes the By Name, a question pops up asking which name and it searches all the pictures for the name and it opens up the picture on the screen that was requested. Same for all the other buttons. How do I code each Command Button to do what I want them to do?

Any help in this would be greatly appreciated! Thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I'd use a combo instead of a whack of buttons, then you only have to code for one event. I imagine I'd use a button click for that (after the combo choice is made). You could have "All" as a list choice; regardless, I suspect you'd use either the msoFileDialogFolder picker if you want the use to pick a folder, or the msoFileDialogFilePicker if you want to load image files. Don't know what to suggest re: the file names (no clue as to what they look like) but you could loop over the image files in a folder and open them if their name contains a search value. That can be unpredictable - you can end up opening files where the search word is part of a larger word (e.g. search word is "truck", which is in "struck").
 
Upvote 0
I'd use a combo instead of a whack of buttons, then you only have to code for one event. I imagine I'd use a button click for that (after the combo choice is made). You could have "All" as a list choice; regardless, I suspect you'd use either the msoFileDialogFolder picker if you want the use to pick a folder, or the msoFileDialogFilePicker if you want to load image files. Don't know what to suggest re: the file names (no clue as to what they look like) but you could loop over the image files in a folder and open them if their name contains a search value. That can be unpredictable - you can end up opening files where the search word is part of a larger word (e.g. search word is "truck", which is in "struck").
They wanted to stay away from a drop down box, because of how many pictures they would have listed. That's why they just wanted a pop-up box that asked them who they want to show the picture(s) of.
 
Upvote 0
I didn't mean list the pictures in the combo. I meant something like
- one combo (choose: all, by name, by function, by year, by student id, etc.)
- combo afterupdate event opens input box where user enters appropriate value
- Select Case block determines what to search for, like
VBA Code:
Select Case cmbMyCombo
  Case "all"
    do this
  Case "name"
    do this
  Case "and so on"
End Select
The "do this" part would probably call a function or sub that accepts the Case value and that value modifies the behaviour of the file or folder picker dialog accordingly.
 
Upvote 0

Forum statistics

Threads
1,213,490
Messages
6,113,956
Members
448,535
Latest member
alrossman

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