![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 119
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: New York
Posts: 71
|
Not sure what code you're otherwise using, but I suggest you select visible cells after the filter.
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 119
|
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 |
|
Board Regular
Join Date: Mar 2002
Posts: 119
|
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 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|