Results 1 to 4 of 4

Thread: NOT (XL2K SR1)

  1. #1
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Blue Springs, Missouri, USA
    Posts
    108
    Thanks
    1
    Thanked 0 Times in 0 Posts

    NOT (XL2K SR1)

    I want to check the state of AutoFilter and if it is on, then turn it off. If it is off, leave it alone. I have tried this
    If Selection.AutoFilter=True then Not Selection.Autofilter
    But that doesn't work.
    If someone can give me the right direction to go... I would greatly appreicate it.

    Dennis

    <img src=/S/gramps.gif border=0 alt=gramps width=20 height=20>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: NOT (XL2K SR1)

    Try
    Selection.AutoFilter = Not Selection.AutoFilter
    Note that there is no If ... Then ... here.

  3. #3
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Blue Springs, Missouri, USA
    Posts
    108
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: NOT (XL2K SR1)

    Hans...

    Thanx for the reply... but I want to check the state first... and only if it is on do I want to turn it off. If it is off, I want to leave it alone. That is where I am running in to the problem, how to check the state.

    Dennis

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: NOT (XL2K SR1)

    OK, forget my previous reply. Try this instead:

    If ActiveSheet.AutoFilterMode = True Then
    ActiveSheet.AutoFilterMode = False
    End If

Posting Permissions

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