+ Reply to Thread
Results 1 to 4 of 4

populating a listbox from a search query

  1. #1
    Registered User
    Join Date
    01-31-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    19

    populating a listbox from a search query

    All,

    I have a small problem with a macro.

    On the attached spreadsheet, I have a command button on the search results spreadsheet that opens a userform to show the individual records with populated data.

    This is working fine. The problem is when I use the 'drill down' button beforehand.

    As an example, I search for the language "Italian". I then drill down to find "Females". When I click the command button and click Find, I only want the 3 records for the females, not the 7 that match the original search.

    I know where in the macro changes are required, I just don't know what to change it to.

    Can someone help?

    Thanks
    Attached Files Attached Files
    Last edited by James_B; 02-16-2010 at 09:25 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: populating a listbox from a search query

    Hi,

    Try the attached,

    I think the extracting can be simplified by using an advanced filter instruction which only requires one line of code. It meant adding a few extra range names and making the column labels unique but you should be able to see the general idea. I moved your original button and combobox out of the way and just let the twin input cells F2 & G2 be drop down cells with a Filter Records button alongside.

    HTH
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-31-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: populating a listbox from a search query

    Thanks for the response.

    I need to test this fully, but it looks as though I can amend the code slightly to add in more criteria to reduce searches further.

    I will let you know how I get on.

    Thanks again

  4. #4
    Registered User
    Join Date
    01-31-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: populating a listbox from a search query

    Sorry it took so long to get back.

    Works great! Solved my other problem at the same time!

    Thanks for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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