Consulting

Results 1 to 8 of 8

Thread: Multiple Combobox

  1. #1

    Multiple Combobox

    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.

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    You mention combobox 1 & 2 so what is your issue? displaying the value on the worksheet is easy enough[VBA]Range("A1").Value = Combobox1.value[/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    Quote Originally Posted by Simon Lloyd
    You mention combobox 1 & 2 so what is your issue? displaying the value on the worksheet is easy enough[vba]Range("A1").Value = Combobox1.value[/vba]
    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

  4. #4
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    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 you[vba]Sheets(combox1.value & "/" & combobox2.value).activate[/vba]this assumes that your sheet is named apples/pears
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  5. #5
    Quote Originally Posted by Simon Lloyd
    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 you[vba]Sheets(combox1.value & "/" & combobox2.value).activate[/vba]this 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"

  6. #6
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Why not just have a dropdown with ALL sheets availabe and they just choose the sheet they want?
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  7. #7
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Take a look here for exactly the instructions you need http://stackoverflow.com/questions/5...for-worksheets
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  8. #8
    Quote Originally Posted by Simon Lloyd
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •