Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox and vba auto filter
XL2K3 Listbox
A B C D RG 1 8 9 8P 2 1 3 Total 12 RG 1 8 2P 8P 2 1 7P The top rows above 'Total' are a List box (filtered). below 'Total' are rows with value (RG,2P) summing up to the ListBox. I recorded a macro and copied it into: Private Sub Worksheet_Change(ByVal Target As Range) If xx 0 Then xx = 0 On Error GoTo 0 Exit Sub End If xx = 0 On Error Resume Next Range("E4").Select Worksheets("sheet 1").ShowAllData On Error GoTo 0 Range("E4").Select xx = 1 Selection.AutoFilter Field:=4, Criteria1:="0", Operator:=xlAnd ' range("C11").Select End Sub This works, but the ListBox stays active and the List box filter does not filter until after I select another cell outside the List box. Can a List Box be automated like this or do you need to loop through using 'long hand' VBA counts and items.... Any Help appreciated. TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to filter listbox data in a form? | Excel Discussion (Misc queries) | |||
DataFilterAuto Filter in excel 2007? | New Users to Excel | |||
Setting and filter Listbox data | Excel Discussion (Misc queries) | |||
ListBox filter | Excel Programming | |||
Filter Listbox in user form | Excel Programming |