Combo Box Dropdown Menu

G

Guest

I have a combo box on a master sheet that lists an alphabetical menu of files
for users to open. How do I attach hyperlinks to these files in the dropdown
menu, so that users may scroll through the menu pick the file they want and
then press a command button to open up the chosen file from the master sheet.
The drop down menu also functions as a link to a seperate database so I may
have to combine the code. Any suggestions?
 
G

Guest

If the combo box is called cboSelectedFile then
add the following code in the button's click event

Workbooks.open FileName:=cboSelectedFile
 
N

NickHK

If they are not Excel file, you could use:
ThisWorkbook.FollowHyperlink combo1.text

NickHK
 
G

Guest

The code to open the selected file becomes

Workbooks.open FileName:=cboSelectedFile.List(,1) & cboSelectedFile.List(,0)
(You might have got confused because I had earlier used cboSelectedFile as
the name of the combobox and later used the name ComboBox1. Sorry for that.)

So you put this piece of code whereever you want to open the file. If you
want to open the file when a user clicks on a button then you put this in the
button's click event. Yoou could also put this code in the combobox's click
event. If you do this then everytime a user click and selects an entry from
the Combobox the corresponding file will open. Hence it all depends on the
design of your application.

Alok
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top