+ Reply to Thread
Results 1 to 11 of 11

Extract records based on User Form selection

  1. #1
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    858

    Extract records based on User Form selection

    I have a user form with a unique list of categories. These categories have sub-categories. Once I select a category on the user form, I would like to extract all the sub-categories for that category? I have attached a test file.
    Thanks in advance.TestFile1.xlsm

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Extract records based on User Form selection

    Range("B:C").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
    "OutputRange"), Unique:=True

    you were filtering only on the subcats.

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Extract records based on User Form selection

    maybe so
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    858

    Re: Extract records based on User Form selection

    Thank you. This works perfectly. But is there a way to update the records without clicking the OK button so the records are updated as you scroll from category to category?

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Extract records based on User Form selection

    try it
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    858

    Re: Extract records based on User Form selection

    Thanks very much! I have another question but need to make some adjustments first.

  7. #7
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    858

    Re: Extract records based on User Form selection

    Is there a way I could have a second list box on the user form that will populate based on the selection chosen in the first list box? The first list box will have the categories and the second list box the sub-categories. In the spread sheet, I show data based on the selection chosen for category and sub-category. Ideally, I would like to choose a category from the list box and have the sub-categories for that category populate in the 2nd list box. I can then select different sub-categories and different data will be displayed for each unique sub-category. I can deal with the display of data based on the different selections but my problem is how to populate the 2nd list box based on a selection from the 1st list box?
    Thanks in advance

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Extract records based on User Form selection

    try it (see attachment)
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    858

    Re: Extract records based on User Form selection

    Brilliant! Thank you very much. That is exactly what I was looking for.

  10. #10
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    858

    Re: Extract records based on User Form selection

    When I select an option in Listbox1, is it possible for the first item in Listbox2 to be automatically highlighted as I am linking the selection in the list boxes to different range names. I have attached a sample file.
    Thanks in advance.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    858

    Re: Extract records based on User Form selection

    I have managed to partly get this right but when I display the user form the sub-category is not displayed in the cell allocated. It only displays after I Click in the 2nd List box? Any assistance would be appreciated. I have attached the sample file with my changes.
    Thanks in advance
    Attached Files Attached Files

+ 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