+ Reply to Thread
Results 1 to 13 of 13

I need to filter my listbox with my Combo box

  1. #1
    Registered User
    Join Date
    03-15-2021
    Location
    Bristol UK
    MS-Off Ver
    2019
    Posts
    21

    I need to filter my listbox with my Combo box

    Afternoon All

    How can you filter a listbox with a combo box

    MT in advance

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: I need to filter my listbox with my Combo box

    A couple I 'knock-up' earlier.
    torachan.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-15-2021
    Location
    Bristol UK
    MS-Off Ver
    2019
    Posts
    21

    Re: I need to filter my listbox with my Combo box

    I wonder if I could send my workbook to you?
    Sorry struggling to get my head around how to filter the Listbox?
    Combobox Model_Type needs to Filter Listbox Quote Details.
    Combobox to filter the second column in Listbox Vehicle Model.

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: I need to filter my listbox with my Combo box

    See big yellow banner - how to upload a workbook - desensitise any confidential info - note the 'paperclip' attachment does not work.
    The purpose of the site is to put solutions into the public domain, so doing then advantages many, rather than just the individual.
    Also then as others subscribe to the link more solutions are explored.
    torachan.

  5. #5
    Registered User
    Join Date
    03-15-2021
    Location
    Bristol UK
    MS-Off Ver
    2019
    Posts
    21

    Re: I need to filter my listbox with my Combo box

    I am having a go at a solution myself see below.
    But it says Run-Time Error 381?


    HTML Code: 

  6. #6
    Registered User
    Join Date
    03-15-2021
    Location
    Bristol UK
    MS-Off Ver
    2019
    Posts
    21

    Re: I need to filter my listbox with my Combo box

    Here is the workbook
    Attached Files Attached Files

  7. #7
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: I need to filter my listbox with my Combo box

    Your error is not in the code you posted (I have no way of running that yet as there is a multitude of errors prior to it).
    The error is the line between the two 'Stop' commands in the SnipClip.
    I will look at your other query later - however a lot of your code thinking is alien to me and needs a mass tidy-up.
    torachan.Capture.JPG

  8. #8
    Registered User
    Join Date
    03-15-2021
    Location
    Bristol UK
    MS-Off Ver
    2019
    Posts
    21

    Re: I need to filter my listbox with my Combo box

    I`ve Taken that line away and the Listbox fill works.
    But my headers are not working on the Listbox
    The header is true on the properties window for Listbox?

    Also when I try to run it it says Run-Time error 91
    Last edited by DarrenSmith1981; 03-17-2021 at 06:14 AM.

  9. #9
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: I need to filter my listbox with my Combo box

    The ModelType list box is going round in circles, you are trying to part fill by the additem method after you have partly filled from Worksheet("Drawing No")
    This confusion needs to be resolved before you even look at headers.
    Headers are only available to the 'rowsource' fill method - which is best avoided as it is the least stable method and least versatile.
    I think you need to revisit this app as it becoming a 'patchwork' of disjointed code.
    Take a step back and debug what you have produced.
    Step one, place 'Option Explicit' at the head of the 'UserForm' code - step two, take all of your declarations (Dim statements) out of all the Subs and place them at the head of the code immediately under 'Option Explicit' - now run 'Debug' and correct each error as they occur - then maybe the 'firefighting' can begin.
    torachan.

  10. #10
    Registered User
    Join Date
    03-15-2021
    Location
    Bristol UK
    MS-Off Ver
    2019
    Posts
    21

    Re: I need to filter my listbox with my Combo box

    The ModelType list box is going round in circles, you are trying to part fill by the additem method after you have partly filled from Worksheet("Drawing No")
    This confusion needs to be resolved before you even look at headers.

    I think I`ve solved the above error above but now have Run-Time error 1004.

  11. #11
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: I need to filter my listbox with my Combo box

    Without details of what you have altered we waste time guessing ???????????????
    As a minimum post your code changes.

  12. #12
    Registered User
    Join Date
    03-15-2021
    Location
    Bristol UK
    MS-Off Ver
    2019
    Posts
    21

    Re: I need to filter my listbox with my Combo box

    Ok sorry.

    When I try to open the form it says run time error 1004

    Gets to this line below then crashes?

    HTML Code: 
    HTML Code: 
    Last edited by DarrenSmith1981; 03-17-2021 at 12:31 PM.

  13. #13
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: I need to filter my listbox with my Combo box

    You are dealing with a table not a range.
    the syntax is slightly different.
    not sure why you have chosen column 3 ??????
    there is no warning use a copy sheet to trial.

    replace this
    Please Login or Register  to view this content.
    with this

    Please Login or Register  to view this content.

+ 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] Filter Listbox or Search Listbox using Textbox
    By crowmagnus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2020, 08:34 AM
  2. [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
  3. Populate (ca 200) Txtboxes depending on listbox selection, live-filter for listbox &1 more
    By InternInNeed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2016, 09:56 AM
  4. using Multiple combo box to filter records of listbox using excel vba
    By ballu_2010 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2014, 07:51 AM
  5. Replies: 8
    Last Post: 12-26-2013, 02:23 PM
  6. Great Combo Filter/Search form, cant get DATE filter to integrate. HELP
    By fau5tu5 in forum Access Programming / VBA / Macros
    Replies: 4
    Last Post: 05-18-2009, 05:05 PM
  7. [SOLVED] listbox or combo box and how?
    By Kim K in forum Excel General
    Replies: 13
    Last Post: 03-04-2006, 08:30 AM

Tags for this Thread

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