Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.51 KB

Excel.PivotField.LayoutForm.md

File metadata and controls

50 lines (30 loc) · 1.51 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotField.LayoutForm property (Excel)
vbaxl10.chm240122
vbaxl10.chm240122
Excel.PivotField.LayoutForm
5e0fee89-111f-0bd4-e880-72cc0925c364
05/04/2019
medium

PivotField.LayoutForm property (Excel)

Returns or sets the way the specified PivotTable items appear—in table format or in outline format. Read/write XlLayoutFormType.

Syntax

expression.LayoutForm

expression A variable that represents a PivotField object.

Remarks

For xlOutline, the LayoutSubtotalLocation property specifies where the subtotal appears in the PivotTable report. xlTabular is the default.

You can set this property for any PivotTable field; however, the formatting appears only if the specified field is a row field other than the innermost (lowest-level) row field.

For non-OLAP data sources, the value of this property doesn't change when the field is rearranged or when it is added to or removed from the PivotTable report.

Example

This example displays the state field in the first PivotTable report on the active worksheet in outline format, and it displays the subtotals at the top of the field.

With ActiveSheet.PivotTables("PivotTable1") _ 
 .PivotFields("state") 
 .LayoutForm = xlOutline 
 .LayoutSubtotalLocation = xlTop 
End With

[!includeSupport and feedback]