O'Reilly logo

Programming Excel with VBA and .NET by Steve Saunders, Jeff Webb

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

pivottable.PivotTableWizard([SourceType], [SourceData], [TableDestination], [TableName], [RowGrand], [ColumnGrand], [SaveData], [HasAutoFormat], [AutoPage], [Reserved], [BackgroundQuery], [OptimizeCache], [PageFieldOrder], [PageFieldWrapCount], [ReadData], [Connection])

Synopsis

Quickly creates a pivot table and returns a reference to the created PivotTable object.

Argument

Settings

SourceType

An xlPivotTableSourceType constant indicating the source of the data to use in the pivot table. Can be xlConsolidation, xlDatabase, xlExternal, or xlPivotTable.

SourceData

If SourceType is xlConsolidation, xlDatabase, or xlPivotTable, a Range object containing the source for the pivot table. If SourceType is xlExternal, an array containing the SQL query string used to retrieve the data for the pivot table.

TableDestination

The Range object indicating the location of the upper-left corner for the new pivot table.

TableName

A name to assign to the pivot table. Default is PivotTable n.

RowGrand

True displays grand totals for rows; False omits row totals. Default is True.

ColumnGrand

True displays grand totals for columns; False omits column totals. Default is True.

SaveData

If SourceType is xlExternal, True reads all of the fields from the data source and False delays retrieving the data until the pivot cache is refreshed. Default is True.

HasAutoFormat

True automatically adjusts column widths when the pivot table is refreshed; False preserves column widths ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required