Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto Filter (XP02)

    As you know when autofilter is applied to a row you can click on a down arrow to obtain a list of the filtered information. What I would like to do is print the current page for each item listed. Please refer to the example below.

    Thanks,
    John

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Auto Filter (XP02)

    I am not clear what you want to print.

    If you are after a list of the unique items, this filtered list would have to be obtained via a macro and you would have to generate it with code, excel does not store it anyplace (or it is inaccessible to the user).

    Steve

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Filter (XP02)

    Steve,

    You are correct in stating that it would have to be done by code. I am not sure how to pass the criteria ie 1, 3, 4 and 5 via code.

    If I use: Selection.AutoFilter Field:=1, Criteria1:="3"

    The criteria of course is set to three. What I'm after is to pass each value in the autofilter list to the criteria and print a specific range or print area. My example shows only four items in the list while my actual list consists of well over a hunderd.

    John

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Auto Filter (XP02)

    You would:
    1)extract the unique list
    Here is some code from John Walkenbach's site that shows how to fill a listbox with a sorted list of unique items from a range, that you can modify to get the unique list.
    once you have the unique list,
    2) loop thru the list
    3) grabbin each unique item
    4) putting it into the autofilter criteria (like the line you have)
    5) doing whatever you want to do with the filtered list
    6) end of loop

    I am still not sure what you are after, but you can also use:
    Pivot table to get summary info based on the unique items without doing any coding
    or
    Advanced filter to extract out unique portions.

    Steve

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Filter (XP02)

    Steve,

    Thanks for the link.

    I'm going to try using something like:

    For i = 1 To 150
    Selection.AutoFilter Field:=1, Criteria1:=i
    Next i



    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •