Syntax

expression.LocationInTable

expression A variable that represents a Range object.

Remarks

XlLocationInTable can be one of these XlLocationInTable constants.
xlRowHeader
xlColumnHeader
xlPageHeader
xlDataHeader
xlRowItem
xlColumnItem
xlPageItem
xlDataItem
xlTableBody

Example

This example displays a message box that describes the location of the active cell within the PivotTable report.

Visual Basic for Applications
Worksheets("Sheet1").Activate Select Case ActiveCell.LocationInTable Case Is = xlRowHeader MsgBox "Active cell is part of a row header" Case Is = xlColumnHeader MsgBox "Active cell is part of a column header" Case Is = xlPageHeader MsgBox "Active cell is part of a page header" Case Is = xlDataHeader MsgBox "Active cell is part of a data header" Case Is = xlRowItem MsgBox "Active cell is part of a row item" Case Is = xlColumnItem MsgBox "Active cell is part of a column item" Case Is = xlPageItem MsgBox "Active cell is part of a page item" Case Is = xlDataItem MsgBox "Active cell is part of a data item" Case Is = xlTableBody MsgBox "Active cell is part of the table body" End Select
Discover the location in a pivot table of a certain range? location location in table Location In Table Property locationin LocationInTable LocationInTable Property What part of the pivottable is a certain cell in?

See also: