![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: Apr 2002
Location: Kansas City, MO
Posts: 14
|
I need VBA code to control auto filter criteria and operators.
For example, if a user selects vehicles > $20,000 in a userform, the filter will automatically set the autofilter on the data in the worksheet to "greater than" and "20,000" for the value and display only those in the worksheet over 20,000. I know how to use autofilter, but the user will only be entering values in user forms and i need it to control the autofilter on a sheet. |
|
|
|
|
|
#2 |
|
New Member
Join Date: Apr 2002
Location: Kansas City, MO
Posts: 14
|
'this works
Dim Class As String Class = ClassBox.Text Worksheets("DATA").Range("A1:AE945").Select Selection.AutoFilter Field:=1, Criteria1:=Class 'This turns on the filter in a sheet named "DATA" on column A, it then enters the critera "Class" which is a string of a selection form a listbox on a userform. Whatever the user selects, becomes the criteria for the filter on column A. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|