+ Reply to Thread
Results 1 to 7 of 7

dependent combobox question

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2021
    Posts
    974

    dependent combobox question

    I have tried to locate past submissions with this problem without success, which would lead me to resolve my issue. So any help would be as always greatly appreciated. I'm trying to link two combo boxes via a user form. I'm trying to select a city in one combobox which in turn would provide a listing of zip codes for that particular city in the next combobox. I've attached a sample of what I'm trying to accomplish. I'm hoping this is possible via the use of a userform. Thanks for your time!
    Attached Files Attached Files
    Last edited by lilsnoop; 02-19-2009 at 11:46 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: dependent combobox question

    HI

    Add the code

    Please Login or Register  to view this content.
    This will update the available zipcodes for the selected city.

    HTH

    rylo

  3. #3
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2021
    Posts
    974

    Re: dependent combobox question

    Thanks Rylo! I've pasted the code in, but it hasn't seemed to do anything for me.. any suggestions?

  4. #4
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2021
    Posts
    974

    Re: dependent combobox question

    It was my mistake, I realized I placed the code in the wrong spot! Thankyou so much for your assistance!!!

  5. #5
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2021
    Posts
    974

    Re: dependent combobox question

    Ok..I do have one more question if I may... In my actual spreadsheet the 1st available column to put my city information is in column "BK" and then my zip codes would be in Column's "BL" & "BM". I've altered the code to refelct the following
    Please Login or Register  to view this content.
    I also changed my the other code
    Please Login or Register  to view this content.
    to reflect the proper listing column, but although my city list appears in the drop down, my zip codes no longer are visible in that combobox. Any ideas what I might be doing wrong?

  6. #6
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: dependent combobox question

    Notice in the code that Rylo provided that the variable [i]i[/] is used in the loop to indicate the column to add to the zip code combobox. Since the first available zip code would not be in column 2, you have to change the line
    Please Login or Register  to view this content.
    . The variable i would have to equal the column that the first zip code is available in (count up to BK or BL), and use that.

  7. #7
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2021
    Posts
    974

    Re: dependent combobox question

    Thanks BigBas! Works great now!

+ 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