Hide Drop Down Arrows in Pivot Table Headings

When you add a field to the Row Label or Column Label area of the pivot table, its heading cell shows a drop down arrow. When you click the arrow, you’ll see Sort and Filter options, for the selected field.

In the screen shot below, you can see the sort and filter options for the Product field, and the check boxes for manually filtering the list.

labelfilter01

Hide the Arrows

If you want to prevent manual filtering, you can hide the drop down arrows, by using a bit of Excel VBA programming.

The following code will hide the drop down arrow for every field in the first pivot table on the active worksheet.

Sub DisableSelection()
Dim pt As PivotTable
Dim pf As PivotField
Set pt = ActiveSheet.PivotTables(1)
  For Each pf In pt.PivotFields
      pf.EnableItemSelection = False
  Next
End Sub

Sorting and Filtering Still Available

After you hide the arrows, you will still be able to sort the pivot items, by using the commands on the Ribbon.

ribbonsort01

You’ll also be able to use the Label Filters and Value Filters, if you right-click on an item in the disabled field.

labelfilter02

Show the Arrows

After you hide the arrows, you can use similar code to show them again — just change the EnableItemSelection setting to True.
The following code will show the drop down arrow for every field in the first pivot table on the active worksheet.

Sub EnableSelection()
Dim pt As PivotTable
Dim pf As PivotField
Set pt = ActiveSheet.PivotTables(1)
  For Each pf In pt.PivotFields
      pf.EnableItemSelection = True
  Next
End Sub

Video: Apply Multiple Filters to Pivot Field

To see the different types of filters – label, value and manual – please watch this short video tutorial.

Or watch on YouTube: Apply Multiple Filters to Pivot Table Field

________________

5 thoughts on “Hide Drop Down Arrows in Pivot Table Headings”

  1. Hi!
    I tried copy / paste the VBA code for hiding dropdown arrows; it worked for some fields but not all of them?
    I pasted the code onto the ‘Generak Section’for my worksheet. Is that correct?
    Many thanks in advance

    Amelie

    1. Make sure to save your file as a MACRO file.
      After you save, you run the VBA code and it should work 🙂

  2. How would one modify the code to remove the flags on whichever is the active pivot table, or for all pivot tables in a workbook? Can I use the pivot table name somewhere in the code?

    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.