Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: autofilter by selection

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a userform set-up to autofilter 22 colums of data, Shown in a listbox. There are five different criterias you can use to get the stated result. That all works fine.
    What I want to be able to do is after sorting by certain criteria beable to select an entry in the listbox. (I use the second column in which I have a mm/dd/yy hh:mm:ss format set-up.) and print it to another worksheet.
    Believe it or not this all works fine if I have not filtered the list at all. Once I filter the list using any of the five criteria, the filter results come back with all entries.
    I am using this code to filter by after making the selection.
    Selection.AutoFilter Field:=2, Criteria1:=raloku.ListBox1.Value
    Any ideas would be appreciated.

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    NY
    Posts
    1,056
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Not sure what code you're otherwise using, but I suggest you select visible cells after the filter.

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Selecting the visible cells is ok.

    If I stop the macro right after the autofilter, it shows all selections, it does not find a match.

    But it finds the match if no other search criteria was used-

    What am I missing.

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    What was going wrong was that the listbox rowsource was linked to the hidden sheet after copying results.
    When I would clear that sheet to accept the new filtered data it was deleting the value of the listbox.
    This was not an issue until now because filter criteria was always being selected from multiple comboboxes.
    I am sure this is not the correct way, but I got around it by setting up a label.visible=false to hold the listbox value before the clear event.
    It now works.

    [ This Message was edited by: d-alan on 2002-03-29 12:17 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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