Link to home
Start Free TrialLog in
Avatar of DarrenJackson
DarrenJacksonFlag for United Kingdom of Great Britain and Northern Ireland

asked on

run excel vb script based on combobox

Guys,

I need some help. I have attached an excel sheet which has a combobox in sheet "MAIN" what I want it to do is look at a specific folder and list all the subfolders so that I can choose. Then when you press the IMPORT button I want the vb code behind the IMPORT button to use what I have chosen in the combobox to execute the script.

Can anyone help
Book1.xlsm
Avatar of kyodai
kyodai

Do it like this...

if Combo1.ListIndex = 0 then
'execute first script
RunScriptOne
elseif Combo1.ListIndex = 1 then
'execute second script
RunScriptTwo
...
Avatar of DarrenJackson

ASKER

HI kyodai thanks for helping.

The example you have given wont give me the ability for my combobox to look up folders within a subfolder.

I think you have misread my question
SOLUTION
Avatar of kyodai
kyodai

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Where would I place this within my attached excel file so that when I press on the drop down box within my combobox I get the folders within C:\  ?

Regards
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Rory this is perfect.

Thankyou for this.