+ Reply to Thread
Results 1 to 6 of 6

Selecting more than two items in an AutoFilter

  1. #1
    Forum Contributor tangcla's Avatar
    Join Date
    06-04-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    136

    Selecting more than two items in an AutoFilter

    OK, please interrupt me where I can improve on processes.
    As part of my macro, I need to select ten items in my table of data to import into another worksheet.

    Is there a way to select more than two if I edit the macro code itself? I tried but it didn't seem to work, by extending the line to include further Criterion:

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor tangcla's Avatar
    Join Date
    06-04-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    136
    OK, here's a sample file.

    basically, say I want to automate a copy-paste of only "Fuel Sales", "C-Store Sales", "car Wash Sales/GP", "SALES", "GROSS PROFIT" - how would you do it?
    I'll need to macro-ize it, too.


    My two thoughts:
    a) Learn how to do a filter function which can do more than two variables
    b) Learn how to specify relative cell references in rows (i.e. "down one row")
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Use the advanced filter. With your example file run the following code.

    Please Login or Register  to view this content.
    rylo

  4. #4
    Forum Contributor tangcla's Avatar
    Join Date
    06-04-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    136
    At the risk of looking noob... how does one use this code you have provided?

    Tried using it as a macro and it didn't do anything...
    Last edited by tangcla; 06-19-2008 at 12:50 AM.

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Open your example file, ALT F11, Insert, Module, paste the code, run the code, then view the output on sheet2.


    rylo

  6. #6
    Forum Contributor tangcla's Avatar
    Join Date
    06-04-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    136
    Ohhhh didn't realise it output the files into Sheet2!

    Now I gotta see if I can butcher this code into a macro of sorts...

    Thanks again, you're my hero rylo

+ 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