EXCEL USING AUTOFILTER with VBA PROBLEM!!
EXCEL USING AUTOFILTER with VBA PROBLEM!!
(OP)
HI
IT'S POSSIBLE TO COPY the FIELDS of an EXCEL AUTOFILTER (the dropdown list) in a combobox list??![[ponder] ponder](https://www.tipmaster.com/images/ponder.gif)
![[neutral] neutral](https://www.tipmaster.com/images/neutral.gif)
![[neutral] neutral](https://www.tipmaster.com/images/neutral.gif)
I want to choose the field to apply to a column using a combobox of a userform:
Selection.AutoFilter field:=3,Criteria1:=Me.ComboBox1.Value
There is a way to have Combox1 list the same as filter fields list?
![[thumbsup2] thumbsup2](https://www.tipmaster.com/images/thumbsup2.gif)
![[peace] peace](https://www.tipmaster.com/images/peace.gif)
LET ME KNOW
IT'S POSSIBLE TO COPY the FIELDS of an EXCEL AUTOFILTER (the dropdown list) in a combobox list??
![[ponder] ponder](https://www.tipmaster.com/images/ponder.gif)
![[neutral] neutral](https://www.tipmaster.com/images/neutral.gif)
![[neutral] neutral](https://www.tipmaster.com/images/neutral.gif)
I want to choose the field to apply to a column using a combobox of a userform:
Selection.AutoFilter field:=3,Criteria1:=Me.ComboBox1.Value
There is a way to have Combox1 list the same as filter fields list?
![[peace] peace](https://www.tipmaster.com/images/peace.gif)
LET ME KNOW





RE: EXCEL USING AUTOFILTER with VBA PROBLEM!!
CODE
'fill the collection from worksheet w, cells A2, A3, ...
i = 2
On Error Resume Next
Do While w.Cells(i, 1).Value <> ""
c.Add w.Cells(i, 1).Value, CStr(w.Cells(i, 1).Value)
i = i + 1
Loop
'Sort the collection, if you want.
'Insert your favorit routine here.
'Add the items of the collection into the combobox
For Each p In c
Me.ComboBox1.AddItem p
Next p
Cheers,
Joerd
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.