Class PivotLine (Excel VBA)

A PivotLine object is a line of rows or columns in an Excel PivotTable.

Set

To use a PivotLine class variable it first needs to be instantiated, for example

Dim lngIndex As Long: lngIndex = 
Dim pas As PivotAxis: Set pas = 
Dim pvtlnPivotLine As PivotLine
Set pvtlnPivotLine = pas.PivotLines(Index:=lngIndex)

The following procedures can be used to set variables of type PivotLine: PivotCell.PivotColumnLine, PivotCell.PivotRowLine, PivotField.AutoSortPivotLine, PivotLines.Item and PivotAxis.PivotLines

For Each

Here is an example of processing the PivotLine items in a collection.

Dim pas As PivotAxis: Set pas = 
Dim pvtlnPivotLine As PivotLine
For Each pvtlnPivotLine In pas.PivotLines
	
Next pvtlnPivotLine

LineType

Returns an XlPivotLineType constant that indicates the type of PivotLine.

Possible Values are xlPivotLineBlank - Blank line after each group, xlPivotLineGrandTotal - Grand Total line, xlPivotLineRegular - Regular PivotLine with pivot items, xlPivotLineSubtotal - Subtotal line.

Parent

Returns the parent object for the specified PivotLine object. Read-only.

PivotLineCells

Returns a collection of PivotCell objects in a PivotLine.

PivotLineCellsFull

Retrieves all the PivotLine cells including those that are hidden in compact form.

Position

Returns or sets the position of the PivotLine object.

PivotLines.Count

Returns the number of items in the PivotLines collection.

PivotLines.Item

Returns a specific element of the PivotLines collection object by its position in the collection.

Syntax : expression.Item (Index)

Index: Specifies the position of an element of the collection.

PivotLines.Parent

Returns the parent object for the specified PivotLines object. Read-only.