+ Reply to Thread
Results 1 to 3 of 3

Autofilter on a column of operators

  1. #1
    Registered User
    Join Date
    08-28-2019
    Location
    Michigan
    MS-Off Ver
    2013
    Posts
    2

    Autofilter on a column of operators

    I've got a column of operators (=, <, >, <=, >=) and I'm trying to autofilter the data in VBA excel with the following code:
    Activesheet.range("A:BB").AutoFilter Field:=23, Criteria1:="<", operator:=xlFilterValues

    I'm trying to filter the data to only show the rows with < in the specified column but I can't get it to work. After the code runs, it shows this column as filtered but none of the filtered boxes are checked and it hides all of my data. I've tried doing the macro recorder and that is the exact code it spits out, but when I try running it in VBA it runs but doesn't work at all (hides all data).

    Any help on this would be appreciated, thank you in advance!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Autofilter on a column of operators

    Hi and welcome to the forum

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-28-2019
    Location
    Michigan
    MS-Off Ver
    2013
    Posts
    2

    Re: Autofilter on a column of operators

    That worked -- thank you so much!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. if with logical operators
    By dagobax in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-12-2014, 07:19 AM
  2. Arithmetic operators
    By hamidciv in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2012, 02:12 PM
  3. Formula operators
    By Wellin in forum Excel General
    Replies: 3
    Last Post: 04-29-2012, 07:41 AM
  4. Operators reversed
    By jacksonville in forum Excel General
    Replies: 2
    Last Post: 12-14-2009, 06:57 PM
  5. [SOLVED] Comparison Operators
    By Devanath Ong in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2006, 10:20 AM
  6. [SOLVED] Need help hiding/unhiding column based on autofilter selection in a different column
    By kcleere in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2006, 02:25 AM
  7. [SOLVED] Operators With Times
    By Michael Link in forum Excel General
    Replies: 2
    Last Post: 03-09-2005, 11:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1