+ Reply to Thread
Results 1 to 11 of 11

ComboBox to filter Listbox Data

  1. #1
    Registered User
    Join Date
    11-28-2018
    Location
    Tamworth, England
    MS-Off Ver
    2016
    Posts
    5

    ComboBox to filter Listbox Data

    Please note that this question has also been posted here: mrexcel.com/forum/excel-questions/1079976-combobox-filter-listbox-data.html
    (Unable to post link due to forum rules)



    Good morning all!

    I am pretty much a newbie but reasonably adept at adapting code (or bludgeoning my way through until I manage to somehow get things working!)

    I am having trouble getting a userform listbox to filter based on combobox selection. To be honest, I dont even know where to begin with making this work..

    My Code is as follows:

    Please Login or Register  to view this content.
    The list box is called: "List of Data"
    The Combo I want to use to filter the data is "ComboBox7"
    The data for the Listbox is stored on "Sheet1"
    Im looking to be able to filter on Row B of the data in sheet 1 (which is Column 2 of the listbox)

    Any help would be greatly appreciated!!

    If it helps, I can also post the workbook.

    Thanks
    Tom
    Last edited by TommyMurphy; 12-12-2018 at 07:44 AM. Reason: Amended to comply with forum rules

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: ComboBox to filter Listbox Data

    You have renamed your controls.

    This makes your coding inefficient.

    Rule 1. Never Rename your controls, It makes Coding Harder


    Please Login or Register  to view this content.
    The above code enters the numbers 1 to 100 in textboxes 1 to 100
    How would you do that if each Textbox has a unique name?


    Rule 2. Number Each Control with the Column Number of its Source Data.


    Please Login or Register  to view this content.
    The above code loads Textboxes 1 to 100 with the data in row 1, columns 1 to 100



    Please Login or Register  to view this content.
    The above code Stores Textboxes 1 to 100 in row 1, columns 1 to 100


    Rule 3. You can have more than one control storing data to the same cell or
    reading data from the same cell

    That is not a problem. As long as they are not the same type of control.

    Eg. Textbox1, Combobox1, Label1 can all read / write to the same cell

    Rule 4. Rule 3 Simplifies Writing data from your controls to your worksheet

    Please Login or Register  to view this content.
    Rule 5. Rule 3 Simplifies Loading data from your worksheet to your controls

    Please Login or Register  to view this content.
    Rule 6. Speed Up Your Userform by Reducing the Number of Times You Read or Write to Excel.
    Write Your Data into an Arrray and Write the Array to Excel.

    Writing Data to Worksheet using An Array.

    Please Login or Register  to view this content.

    Rule 7. Speed Up Your Userform by Reducing the Number of Times You Read or Write to Excel.
    Read your data from Excel into an Arrray and then copy the data into your controls.


    Reading Datafrom Worksheet using An Array.

    Please Login or Register  to view this content.
    Rule 8. Use the Titles On your Spreadsheet as the default text for your Controls



    Please Login or Register  to view this content.
    Last edited by mehmetcik; 12-06-2018 at 07:58 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: ComboBox to filter Listbox Data

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: ComboBox to filter Listbox Data

    Xposted on mrE

  5. #5
    Registered User
    Join Date
    11-28-2018
    Location
    Tamworth, England
    MS-Off Ver
    2016
    Posts
    5

    Re: ComboBox to filter Listbox Data

    Quote Originally Posted by Kyle123 View Post
    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Hi Kyle123.

    Apologies for the late reply, I have been away on holiday!

    Many thanks for the advice, I will work through my project & improve as per your suggestions.

    I have attached a sample of the workbook. It is currently working as I need with the exception of a combobox filter. Any help in getting this to work would be greatly appreciated.
    The filter needs to work on column 2 of the listbox.

    Many thanks for your help this far.

    Tom
    Attached Files Attached Files

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: ComboBox to filter Listbox Data

    Your post does not comply with Rule 3 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    Please make sure to include the full link, so that other members will be permitted to continue helping you

    Note that if you have fewer than 10 posts, you may need to type the link, or past it in pieces (or ask a mod to do that for you)

  7. #7
    Registered User
    Join Date
    11-28-2018
    Location
    Tamworth, England
    MS-Off Ver
    2016
    Posts
    5

    Re: ComboBox to filter Listbox Data

    Hi Kyle123.

    Apologies, I am new to forums & did not understand this rule. Would I be best to delete the other post or link it here?

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: ComboBox to filter Listbox Data

    Just add a link to the first post

  9. #9
    Registered User
    Join Date
    11-28-2018
    Location
    Tamworth, England
    MS-Off Ver
    2016
    Posts
    5

    Re: ComboBox to filter Listbox Data

    Quote Originally Posted by Kyle123 View Post
    Just add a link to the first post
    Link added. Again, apologies for the error

  10. #10
    Registered User
    Join Date
    11-28-2018
    Location
    Tamworth, England
    MS-Off Ver
    2016
    Posts
    5

    Re: ComboBox to filter Listbox Data

    Ok, I managed to get it working. For anyone interested or having the same problem, this is how I did it:

    Please Login or Register  to view this content.

  11. #11
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: ComboBox to filter Listbox Data


+ 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 based on ComboBox selection
    By nimesh29 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-25-2017, 03:14 PM
  2. [SOLVED] UserForm ComboBox Filter ListBox Display
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-07-2017, 04:43 AM
  3. Search/Filter from multiple combobox to a listbox
    By Judith_Chao in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-15-2017, 10:47 AM
  4. Filter UserForm Multicolumn ListBox with TextBox/ComboBox
    By Alex.riccio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-07-2016, 03:12 PM
  5. Checkbox, optionbutton or combobox to filter listbox
    By Claude hauptfleisch in forum Excel General
    Replies: 1
    Last Post: 10-25-2016, 04:51 AM
  6. Using ComboBox on Userform to filter ListBox
    By burger160 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2014, 05:03 PM
  7. [SOLVED] Filter a listbox with a combobox and seach button
    By chin67326 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2014, 03:37 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