+ Reply to Thread
Results 1 to 5 of 5

Autofiltering dropdown menus on userform from external database

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    24

    Autofiltering dropdown menus on userform from external database

    Hi!

    I'm working on a project where I have an external database in the form of an excel sheet, from which I want to extract data based on user choices. To increase efficiency the data shall only be loaded once from the database, and then be temporarily stored locally. For security reasons the bulk of data shall be invisible to the user. The two ways I've been thinking of doing this is either storing the database in an array or copying it to an inaccessible worksheet.

    I then want to apply an autofilter on certain search parameters to make the program as user friendly as possible. Is this even possible to do if the data is stored in an array? I want to place the dropdown menus for doing selections on a userform, and when an option is selected in one I want the amount of choices in the other ones to be reduced as per a normal autofilter. So basically I want to make an autofilter with the header row menus on a userform and the data invisible to the user.

    I haven't been able to figure out how to do this, so any help would be greatly appreciated.

    Cheers!

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Autofiltering dropdown menus on userform from external database

    We need a sample workbook to work out the details.

    Use one of the sheets to simulate the database. Tell us how big the dataset could be.

    Create the userform and how ever many controls needed to satisfy your requirement.

    The more specific info you give us, the better we can help you.

    You can attach the workbook here. Look under Go Advanced, scroll down to manage attachments.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    07-11-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Autofiltering dropdown menus on userform from external database

    Hi David, thanks for answering!

    I guess I could do that if needed, but it will probably be simpler if I simplify my explanation instead.

    So basically, what I want to do is imitate the autofilter function in excel, but with the data stored in an array and the controls on a userform.

    Is this possible to do? With efficiency in mind, how would you go about it?

    Regards,
    Samuel

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Autofiltering dropdown menus on userform from external database

    You can look into Excel builtin query functions to get the database into memory.

    Populate the combobox with first selection.

    When user selects first combobox, you iterate the array again, filtering the next level of data, and so on. That's called cascading comboboxes and there are hundreds of examples on the web.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Autofiltering dropdown menus on userform from external database

    you could load the data into a recordset and then disconnect it. you can then filter the recordset as needed.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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