+ Reply to Thread
Results 1 to 3 of 3

Auto filter based on user input with multiple choices

  1. #1
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Auto filter based on user input with multiple choices

    Dear all,

    I have here an example of how I might extract data from a source workbook and paste it onto a template workbook, using autofilter to find the rows that are needed. It is currently set-up to take rows that match "AREA 1" or "AREA 2" in column A, along with a number of other criteria in other columns.

    What I want to do is add into this macro, a way for the user to be able to choose the filter options will be used for column A of the source workbook. So if they want only "AREA 1", they can choose just that, or if they want "AREA 2", or perhaps both "AREA 1" & "AREA 2", or further additional options. They need to be able to specify just one, multiple, or all of the filter options with regards to column A of the source data.

    In effect what I need is a user input box or form with a dropdown menu that will give the filter choices based on column A of the source data, and then for the code that copies the data across, to do so based on which choices the user makes in the filter menu of the input box.

    I have uploaded examples of the source data workbook and the target template workbook. The macro exists within the template workbook.


    Please Login or Register  to view this content.

    I am looking for someone to demonstrate to me in this example, how it may be possible for the user to be able to specify, one, multiple, or all available filter options for column A of the source data, via a user input box or form.

    Hopefully I have explained clearly enough but if not, please ask me questions. If anyone could assist I would be most grateful..

    Many thanks,
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Auto filter based on user input with multiple choices

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: Auto filter based on user input with multiple choices

    Hi,

    Thanks for that, yes this certainly does the job if the user can type in the required criteria and if I know how many different possible ones there are. My actual problem here is a bit more complicated than that....

    For this to be useful for what I am trying to do, I will have to assume that the user does not know what the available filter options are, that I must present them a list of options from which they can choose 1, some, or all of the available options. The total number of options they choose may vary, as might the number of options that will need to be presented.

    If you look at the attached Sourcedataexample, there is a drop down menu at the top of column A which allows you to filter the sheet by that column, by ticking the boxes next to the ones you want. You can choose just one, some or the whole lot. I need to present this same set of choices somehow to the user when the macro is run, and then take that into account when coping the data to the template. The options presented to the user needs to reflect the options that happen to be available at the time in column A of the source data.

    I need to consider that the content of the source data could change and so the number of options that would need to be presented changes also. If a new area name was added to column A of the source data that didn't already exist, the next time the macro is run I will need that option to also be included in the list of options presented to the user.

    I only need to do this for field 1 / column A, fields 4 & 6 in the above code can remain as they were in my example as the required criteria for those is always the same.

+ 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. Auto filter based on input
    By AUSSIEHEDGE in forum Excel General
    Replies: 0
    Last Post: 02-20-2013, 12:32 AM
  2. Filter by User Input with multiple criteria?
    By jsabo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2012, 06:19 PM
  3. Apply Auto Filter Based on Date Input by User
    By ELDAN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2010, 09:07 PM
  4. Filter Data based on User Input
    By izet99 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2009, 05:51 PM
  5. Replies: 3
    Last Post: 05-19-2005, 08:06 PM

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