+ Reply to Thread
Results 1 to 8 of 8

Change Worksheet based on ComboBox selection

  1. #1
    Forum Contributor dagindi's Avatar
    Join Date
    06-02-2008
    Location
    New York, NY
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    295

    Change Worksheet based on ComboBox selection

    I'm using an active X combo box to control look-ups on a worksheet.

    The primary combo box choices are

    Kitchen
    Bathroom
    Bedroom

    Once selected the following code kicks in (abbreviated due to repetition)

    Please Login or Register  to view this content.
    All the categories listed above work great on the sheet I'm creating, however, lets say I want to add another category as follows:

    Kitchen
    Bathroom
    Bedroom
    Candy

    Is it possible to change to automatically switch to a different sheet in the same workbook that will show different info that needs to be selected?

    Assume that each category has a corresponding sheet in the workbook.

    The ability to switch should also be available from each worksheet in the workbook.

    Thanks!!
    Last edited by dagindi; 05-15-2012 at 08:33 AM.

  2. #2
    Forum Contributor dagindi's Avatar
    Join Date
    06-02-2008
    Location
    New York, NY
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    295

    Re: Change Worksheet based on ComboBox selection

    Giving a bump

  3. #3
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Change Worksheet based on ComboBox selection

    I use this....
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  4. #4
    Forum Contributor dagindi's Avatar
    Join Date
    06-02-2008
    Location
    New York, NY
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    295

    Re: Change Worksheet based on ComboBox selection

    John,

    Thanks for the quick response. First off, with some slight modification as you will see below to bring your code down to my level of VBA understanding, i have a working example that for my purposes will work fine. So thank you for pointing me in the right direction...

    I need a little more clarification on the code.

    I took the code above and copied it into each sheet that I want to be able to switch too. I made the basic modifications so that it would match the worksheets and it didn't work. So I simplified it to its basic function as follows:

    Please Login or Register  to view this content.
    The error I am getting is in reference to each line of code

    Please Login or Register  to view this content.
    I'm not really sure what that line of code is supposed to do since I do not have any textboxes on the sheet.

    I'm also not sure what the code below is going to do either and was hoping you could explain that too.

    Please Login or Register  to view this content.
    I'm assuming that the above code is looking to reference the same list as Combobox1 but I want to make sure i understand it.

    I am attaching a test workbook just in case.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Change Worksheet based on ComboBox selection

    hello!
    my Textbox is used in my UserForm, that's why you rcvd an error.
    my CombBox1 takes values from the active sheet because I have different values.
    I attached a test file for you but I used yr Range for ComboBox1 which is the same for all Sheets.
    it's just an idea!
    Attached Files Attached Files

  6. #6
    Forum Contributor dagindi's Avatar
    Join Date
    06-02-2008
    Location
    New York, NY
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    295

    Re: Change Worksheet based on ComboBox selection

    John,

    Thank you!!

  7. #7
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Change Worksheet based on ComboBox selection

    hi dagindi,

    glad to be of help!

  8. #8
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Change Worksheet based on ComboBox selection

    hi dagindi,

    Thank you for rep and glad to be of help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1