1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Excel 2007 Macro -> Hide Excel AutoFilter Arrows

Discussion in 'Business Applications' started by computerman29642, Dec 4, 2009.

Thread Status:
Not open for further replies.
  1. computerman29642

    computerman29642 Thread Starter

    Joined:
    Dec 4, 2007
    Messages:
    2,895
    I am trying to create a code that will autofilter data on an Excel worksheet. The code works fine to filter the data, but it does not hide the AutoFilter Arrows.

    Below is the code I am using. What (if anything) is wrong with the code below?

    Code:
    ActiveSheet.Range("A1:D500").AutoFilter Field:=2, Criteria1:="<>", Visibledropdown:=False
    
     
  2. computerman29642

    computerman29642 Thread Starter

    Joined:
    Dec 4, 2007
    Messages:
    2,895
    I noticed that the code above (in Post #1) that the AutoFilter Arrows were beinf truned off on Field 2, but none of the others.

    I have played around, and done some research to come up with the code below:

    Code:
    Dim c As Range
    
        For Each c In ActiveSheet.Range("A1:D1")
            ActiveSheet.Range("A1:D500").AutoFilter Field:=2, Criteria1:="<>"
            c.AutoFilter Field:=c.Column, Visibledropdown:=False
        Next
    
    Does anyone have a better solution?
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/882791

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice