+ Reply to Thread
Results 1 to 8 of 8

Active X Combo Box with Range List

  1. #1
    Registered User
    Join Date
    04-28-2013
    Location
    Long Beach, NY
    MS-Off Ver
    Excel 2010
    Posts
    36

    Active X Combo Box with Range List

    I have attached an unprotected worksheet that was created in Excel 2010. This worksheet allows the end user to provide criteria in multiple columns to filter the worksheet's data by the rows that fulfill the criteria entered.

    The other method is allowing the end user to supply criteria via Active X Combo Boxes. The only combo box I am having difficulty with is Total Number of Hospital Beds. This is the only combo box that supplies a list that have different RANGE selections. Unfortunately, I have not found a solution that interprets the items drop down DESCRIPTIONS into its SEARCH criteria. Please help!
    Attached Files Attached Files

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Active X Combo Box with Range List

    See if this works for you.

    Select the combination you want in both combo's of Total Hospital Beds and apply filter.
    Attached Files Attached Files
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    04-28-2013
    Location
    Long Beach, NY
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Active X Combo Box with Range List

    Thanks for your rapid reply. Unfortunately your solution was not what I was looking for.

    The combo box drop down list should show these various choices:

    DESCRIPtION IN DROP DOWN COMBO BOX

    TOTAL HOSPITAL BEDS

    (=> 450) Range from 450 or More
    (<450) Range Less than 450
    Range from 201 to 300
    Range from 301 to 400
    Range from 401 to 500
    Range from 501 to 600
    Range from 601 to 700
    Range from 701 to 800
    Range from 801 to 900
    Range from 901 to 1000

    As you can see, only the 1st two choices are 1 directional (>= or <=)
    All the remaining choices are bi-directional (>= but <=) a limited PRECISE range.

    SEARCH CRITERIA for the DROP DOWN COMBO BOX

    TOTAL HOSPITAL BEDS

    >=450
    <=449
    >=100 but <=200
    >=201 but <=300
    >=301 but <=400
    >=401 but <=500
    >=501 but <=600
    >=601 but <=700
    >=701 but <=800
    >=801 but <=900
    >=901 but <=1000

    So I am wanting to SHOW the DESCRIPTIONS (listed above), however,
    I want the SEARCH CRITERIA for each of these DESCRIPTIONS to be executed.
    This would be my IDEAL solution.

    The other solution would be the DESCRIPTION and SEARCH CRITERIA would be identical in the DESCRIPTION. By this I mean, I mean the DESCRIPTIONS would show the following:

    (>=450
    <=449
    >=100 but <=200
    >=201 but <=300
    >=301 but <=400
    >=401 but <=500
    >=501 but <=600
    >=601 but <=700
    >=701 but <=800
    >=801 but <=900
    >=901 but <=1000

    Items 3 onward are NOT in the correct format to accomplish the filtering I want. What is the correct format (if any)?

    I hope I have been clear!
    Last edited by nytwodees; 05-15-2020 at 11:17 AM.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Active X Combo Box with Range List

    Descriptions as you want them with VBA to monitor combobox listindex.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by bakerman2; 05-15-2020 at 08:54 PM.

  5. #5
    Registered User
    Join Date
    04-28-2013
    Location
    Long Beach, NY
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Active X Combo Box with Range List

    Your solution works perfectly! Thanks for your knowledge, effort, and time.

    I would like to know if this change is possible for Row 2:

    Hospital/Medical Center/Clinic Name - County - Region - Total Hospital Beds - Total Hospital Beds .......................................

    Change to:

    Hospital/Medical Center/Clinic Name - County - Region - Total Hospital Beds - Total Hospital Beds
    ...................................................................................Range FROM......-......Range TO

    If I make these changes, the filtering fails (displays no records).

    Please let me know if and how to make this change. This final change will complete my project!

    Thanks

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Active X Combo Box with Range List

    This can't be done because the filter headers need to be exactly the same as your database headers.

    Otherwise the AdvancedFilter won't work (as you have noticed).

  7. #7
    Registered User
    Join Date
    04-28-2013
    Location
    Long Beach, NY
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Active X Combo Box with Range List

    Thanks again for your rapid reply.

    I do remember that requirement, but I wasn't 100% sure.

    A workaround I used was to add Range FROM and Range TO in the 1st Row in cells above the Total Hospital Beds cells in Row 2.

    Thank you very much for helping me with my Project. I could not have been able able to complete it without your help.

    Dan

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Active X Combo Box with Range List

    Glad to help.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. How to link combo boxes and list boxes in VBA using active x controls
    By LaSouth1776 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2020, 12:46 PM
  2. [SOLVED] Active X Combo list based on Range with hidden rows
    By Aoleone# in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-20-2019, 08:44 PM
  3. [SOLVED] Based on data from combo box , list range of value to another combo box / listbox
    By ajupillai in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-21-2016, 03:35 AM
  4. how to add a Dropdown list in combo box (Active x control)
    By kasun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-16-2014, 04:47 AM
  5. [SOLVED] Need active X list box content to change based off of combo box selection
    By Butcher1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2014, 04:26 PM
  6. [SOLVED] dynamic named range not populating combo box list if range = single cell
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-24-2014, 05:27 PM
  7. Replies: 1
    Last Post: 12-03-2012, 08:55 AM

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