+ Reply to Thread
Results 1 to 9 of 9

Limit Listbox and ComboBox Results

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Limit Listbox and ComboBox Results

    Hello,

    I have a new problem, I would like to minimise the amount of results in my ListBoxes by using ComboBox selections.

    See attached example.

    I would like the ListBox on UserForm1 to show all reference number when no selection is made from the ComboBoxes... When they are left at default settings... Type and Opponent.

    When Type is selected, either Fight or Special, the ListBox is limited to only show results of that type. ie. Special will only show reference numbers that refer to that Type... Barrels, Wall or Car and vice versa. Alternatively if Type is left alone and only an option from the Opponent ComboBox is selected the ListBox would only show references that refer to that Opponent. ie. Honda is selected, it will only show references relating to Honda and the same for all. If Fight was selected then the second ComboBox would only show the names minus Barrels, Wall and Car, and again vice versa.

    When both ComboBoxes are used, say Fight and Ryu, it would limit the ListBox would only show references matching those.

    I really don't know where to start with this, If anyone could help me out it would be much appreciated.

    Regards,

    Cuba

    Example2.xlsm

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Limit Listbox and ComboBox Results

    You can try:
    Please Login or Register  to view this content.
    I wasn't able to test it. There was a glitch on my PC with your spreadsheet.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Limit Listbox and ComboBox Results

    I'm getting errors...

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Limit Listbox and ComboBox Results

    What are the errors? What line?

  5. #5
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Limit Listbox and ComboBox Results

    It errors at "ListBox1.Clear"

  6. #6
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Limit Listbox and ComboBox Results

    Its a "run-time error '-2147467259 (80004005)'

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Limit Listbox and ComboBox Results

    How are you populating the listbox to begin with?

  8. #8
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Limit Listbox and ComboBox Results

    Using "Row Source" I think

  9. #9
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Limit Listbox and ComboBox Results

    Sorted it by removing the row source Thanks

+ 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. Combobox limit by Label value
    By jdasp49 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2013, 01:15 PM
  2. Replies: 2
    Last Post: 12-07-2012, 02:10 AM
  3. item limit for a combobox?
    By KarenH in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-20-2006, 04:35 PM
  4. [SOLVED] Limit entries to combobox
    By Daniel Bonallack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2006, 02:25 AM
  5. ListBox value limit
    By John in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2005, 11:05 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