Changing AutoFilter Drop-Down Arrow Colors

Written by Allen Wyatt (last updated February 4, 2023)
This tip applies to Excel 97, 2000, 2002, and 2003


Gus asked if there was a way to change the color of the drop-down arrows that appear at the top of each column when AutoFilter is turned on. When a filter is not applied to a column, the drop-down arrow is black; when a filter is applied, the drop-down arrow is navy blue. Gus wanted to change the colors because there isn't enough contrast between black and navy blue on his monitor.

Unfortunately, it appears that the color of the drop-down arrows is hard-coded into Excel and cannot be changed. You can try a workaround, if you desire, that would instead color the first cell in each of the filtered columns. Add the following macro to a regular module in the workbook:

Sub ColorDisplayFilter()
    Dim flt As Filter
    Dim iCol As Integer
    Dim lRow As Long

    iCol = 0
    lRow = ActiveSheet.AutoFilter.Range.Row
    Application.EnableEvents = False
    For Each flt In ActiveSheet.AutoFilter.Filters
        iCol = iCol + 1
        If flt.On Then
            Cells(lRow, iCol).Interior.Color = vbYellow
        Else
            Cells(lRow, iCol).Interior.ColorIndex = xlColorIndexNone
        End If
    Next flt
    Application.EnableEvents = True
End Sub

The code steps through the filters for a worksheet and, if the filter is active for a column, colors the first cell yellow. If the filter is not active, then it gets rid of the yellow color.

To trigger the routine so that it runs automatically, there are two things you need to do. First of all, you need to add the following macro to the thisWorkbook object:

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
    If Sh.AutoFilterMode Then ColorDisplayFilter
End Sub

This triggers every time the worksheet is calculated. If the AutoFilterMode property is True, then the coloring macro is executed.

The second thing you need to do is add a SUBTOTAL formula to your worksheet. Assuming that column A is one of the columns in the filter, you could add the following to the worksheet:

=SUBTOTAL(9,A:A)

The SUBTOTAL function is recalculated every time a filter is changed, so this helps ensure that the coloring macro is executed. The formula can be hidden, if desired, but it must be on the worksheet that has the filter to ensure that the sheet triggers the event.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2371) applies to Microsoft Excel 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Copying Worksheets in a Macro

Copying worksheets (one or many) is easy to do manually. What is not well known is that it is even easy to make the ...

Discover More

Viewing Comments

There are three different ways that Excel allows you to display any comments that are in your worksheet. Here's how you ...

Discover More

Y-Axis Chart Titles are Truncated

When creating a chart, you may find that the titles that appear along your Y-axis are being cut off for some reason. ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Using AutoFiltering

Excel's AutoFilter tool is a great way to make a long list of items much more manageable. This tip explains how to set up ...

Discover More

Increasing the AutoFilter Drop-Down Limit

When you turn on AutoFiltering, Excel displays a drop-down list at the top of each column in your data table. This list ...

Discover More

Quickly Identifying Applied AutoFilters

Apply an AutoFilter to a worksheet, and you can quickly forget exactly what that AutoFilter entailed. Here are a couple ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four minus 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.