Last updated: February 6, 2010 1:39 AM
Search Contextures Sites ![]()
Excel Pivot Table Tutorial -- Field Settings
- Manually Hide or Show Subtotals
- Programmatically Hide Subtotals
- Show Items with No Data
- Show Top Items Only
- Sort All Fields in Ascending Order
Download the zipped sample pivot table file for this pivot table tutorial
Show Top Items Only
Instead of showing all the items in a field, you can restrict the Pivot Table to show only the top (or bottom) items.
Sort All Fields in Ascending Order
After adding new records to your data, new items may appear at the end of the existing data, instead of being listed alphabetically. The following code will sort all fields in all Excel Pivot Tables.
Sub SortAllFields() 'pivot table tutorial by contextures.com On Error Resume Next Application.ScreenUpdating = False Dim pt As PivotTable Dim ws As Worksheet Dim pf As PivotField For Each ws In ActiveWorkbook.Worksheets For Each pt In ws.PivotTables pt.ManualUpdate = True For Each pf In pt.PivotFields pf.AutoSort xlAscending, pf.Name Next pf pt.ManualUpdate = False Next pt Next ws Application.ScreenUpdating = True End SubDownload the zipped sample pivot table file for this pivot table tutorial![]()
Pivot Table Tutorial List
Contextures Inc., Copyright © 2009.
All rights reserved.