Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: VBA Code to control autofilter???

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Kansas City, MO
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #2
    New Member
    Join Date
    Apr 2002
    Location
    Kansas City, MO
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    '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.

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
  •