Conditional UserForm for opening specific folders

Capulet

New Member
Joined
Jul 30, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm still very much a beginner when it comes to VBA but my intent is to find a way for a userform to access specific directories to allow the user to select a pre-sorted file.
Below is a very rough draft of what my userform would be displayed as:
UserFormExample.PNG

In this example, the user would have the option of opening Folder1A(Opt1 and OptModifierA), Folder2A(Opt1 and OptModifierA), Folder1B(Opt1 and OptModifierB), or Folder2B(Opt2 and OptModifierB).

Can anyone assist me in how to write the VBA code for this? The final product will have more option buttons, but I want to solidify my knowledge with this example before I branch out. Thank you very much for your time and assistance!

Respectfully,

Cap
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi all,

I'm still very much a beginner when it comes to VBA but my intent is to find a way for a userform to access specific directories to allow the user to select a pre-sorted file.
Below is a very rough draft of what my userform would be displayed as:
View attachment 96225
In this example, the user would have the option of opening Folder1A(Opt1 and OptModifierA), Folder2A(Opt1 and OptModifierA), Folder1B(Opt1 and OptModifierB), or Folder2B(Opt2 and OptModifierB).

Can anyone assist me in how to write the VBA code for this? The final product will have more option buttons, but I want to solidify my knowledge with this example before I branch out. Thank you very much for your time and assistance!

Respectfully,

Cap
What do these represent in terms of folders?
Folder1A(Opt1 and OptModifierA), Folder2A(Opt1 and OptModifierA), Folder1B(Opt1 and OptModifierB), or Folder2B(Opt2 and OptModifierB)

Aee you looking to select multiple files or just one?
 
Upvote 0
What do these represent in terms of folders?
Folder1A(Opt1 and OptModifierA), Folder2A(Opt1 and OptModifierA), Folder1B(Opt1 and OptModifierB), or Folder2B(Opt2 and OptModifierB)

Aee you looking to select multiple files or just one?
Hi Herakles,
Those option/variables would ultimately define which folder/filepath to navigate to. The intent is to allow the user to see the files in that folder and decide which one to open. For this example I would defined the 4 folders as 1=“item1 orders received” 2=“item1 orders fulfilled” 3=“item2 orders received” 4=“item2 orders fulfilled”. Of course this is a poor example; however, it illustrates the general function required.
 
Upvote 0
Hi Herakles,
Those option/variables would ultimately define which folder/filepath to navigate to. The intent is to allow the user to see the files in that folder and decide which one to open. For this example I would defined the 4 folders as 1=“item1 orders received” 2=“item1 orders fulfilled” 3=“item2 orders received” 4=“item2 orders fulfilled”. Of course this is a poor example; however, it illustrates the general function required.
Why not just have a listbox with these options in it?
1=“item1 orders received” 2=“item1 orders fulfilled” 3=“item2 orders received” 4=“item2 orders fulfilled”

Selecting one will prompt the user for a file.

Do these folders share a parent folder?
 
Upvote 0
Why not just have a listbox with these options in it?
1=“item1 orders received” 2=“item1 orders fulfilled” 3=“item2 orders received” 4=“item2 orders fulfilled”

Selecting one will prompt the user for a file.

Do these folders share a parent folder?
It may seem obtuse; however, it is the way the organization would prefer it.
 
Upvote 0

Forum statistics

Threads
1,224,728
Messages
6,180,602
Members
452,989
Latest member
Ol Reliable

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