+ Reply to Thread
Results 1 to 3 of 3

Filtering a userform combobox based on another combobox

  1. #1
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Filtering a userform combobox based on another combobox

    I've read several posts on this but I can't seem to find anything that fits exactly what I need. The closest I've come is on contextures http://www.contextures.com/exceluser...omboboxes.html but it doesn't quite produce the specific result because my first dependency does not repeat. I would also like to know if I can do this without using a hidden sheet, using only vba to filter the results using search find.

    I have a sheet with a dynamically named range (State) that lists states (52). There is another dynamically named range (County) of all the counties within the U.S. (~4500). Each county has a named range code (CS_Code) that correlates to it's relative state (1-52). How would I go about creating an after click event within ComboBox1 (State) that would filter only the counties that belong to its respective state after it is selected within the ComboBox1?

    I know I could separate all the counties into a 52 column range and use something like cascading comboboxes, but 1.) I'm more interested in finding out how I can use a unique id to filter out a respective county and 2.) I don't want to sort and parse out 4600 lines into 52 ranges. I'm afraid I don't have any code because I wouldn't know where to start but I have attached a sample workbook.
    Attached Files Attached Files
    Last edited by terriertrip; 09-22-2017 at 02:47 AM.

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Filtering a userform combobox based on another combobox

    Hi Terriertrip,
    try using a 2-columned Combobox1
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    02-25-2013
    Location
    Colorado, US
    MS-Off Ver
    Microsoft 365 Apps
    Posts
    518

    Re: Filtering a userform combobox based on another combobox

    Thank you, nilem. This is perfect.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] ComboBox to populate Listbox and 2nd Combobox based on 1st combobox dropdown choice
    By bbqqsmokeman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2017, 08:21 PM
  2. [SOLVED] Userform: Change Combobox list based on a second ComboBox selection
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-11-2016, 03:45 PM
  3. ComboBox values source being changed based on another combobox selection in a UserForm
    By stephenanderson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2016, 11:12 PM
  4. Userform Combobox to populate based on selection in another combobox
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2014, 03:34 PM
  5. [SOLVED] VBA Userform ComboBox: Content of ComboBox based off of Conditional Statement
    By Brianandstewie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2013, 03:00 PM
  6. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 PM
  7. [SOLVED] Add RowSource to Userform ComboBox based on value on Another ComboBox
    By Baziwan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2012, 01:17 PM

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