PDA

View Full Version : Multiple Combobox



cherylinn
11-30-2012, 09:33 AM
How to create multiple combo box for comparing of data? For example user want to compare apple and orange. User will choose apple from combo box1 and orange from combobox2. When they click compare, it will bring them to a spreadsheet that show the comparison.

Simon Lloyd
11-30-2012, 03:08 PM
You mention combobox 1 & 2 so what is your issue? displaying the value on the worksheet is easy enoughRange("A1").Value = Combobox1.value

cherylinn
11-30-2012, 09:21 PM
You mention combobox 1 & 2 so what is your issue? displaying the value on the worksheet is easy enoughRange("A1").Value = Combobox1.value

My issue is how to write the vba code to link to a specific page based on the 2 value. Example user choose orange and pear, it link to a orange/pear sheets. User choose papaya and mango, it link to a papaya/mango sheets

Simon Lloyd
11-30-2012, 11:36 PM
What is it you are trying to do exactly? do you just want a dropdown that will take you to a sheet of your choice?, if you want to concatenate combox values to arrive at a sheet it will also depend on hwo the sheet is named but as an example for youSheets(combox1.value & "/" & combobox2.value).activatethis assumes that your sheet is named apples/pears

cherylinn
12-01-2012, 12:34 AM
What is it you are trying to do exactly? do you just want a dropdown that will take you to a sheet of your choice?, if you want to concatenate combox values to arrive at a sheet it will also depend on hwo the sheet is named but as an example for youSheets(combox1.value & "/" & combobox2.value).activatethis assumes that your sheet is named apples/pears

Yup , i just want a dropdown that will take user to the sheet of their choice. How to create if statement for that?
like if user choose apple in combobox 1 and pear in combobox 2 or vice versa, they will go to a sheet name "applepear"

Simon Lloyd
12-01-2012, 12:04 PM
Why not just have a dropdown with ALL sheets availabe and they just choose the sheet they want?

Simon Lloyd
12-01-2012, 12:06 PM
Take a look here for exactly the instructions you need http://stackoverflow.com/questions/5601296/vba-excel-drop-down-list-for-worksheets

cherylinn
12-01-2012, 10:18 PM
Why not just have a dropdown with ALL sheets availabe and they just choose the sheet they want? because there are about lots of sheet that need to be compared. It will look quite messy if i were to put all in one drop down list. To make the excel user-friendly, i wanted to create two drop down where user can just straight away select the 2 items they want to compare and arrive at the comparison page.