Return the filter applied to pivot table in VBA

cr731

Well-known Member
Joined
Sep 17, 2010
Messages
611
How can I return what values field a particular pivot field is sorted by? For instance, my customer pivot table could be sorted descending by either this year sales, next year sales ... and in VBA I want to return into a variable which values field it is current sorted by. How can I get at this information?
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,483
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
The AutoSortField property of the PivotField will tell you that.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,492
Messages
5,523,260
Members
409,506
Latest member
reneekeane

This Week's Hot Topics

Top