Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 1.59 KB

Excel.Range.LocationInTable.md

File metadata and controls

57 lines (42 loc) · 1.59 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Range.LocationInTable property (Excel)
vbaxl10.chm144156
vbaxl10.chm144156
Excel.Range.LocationInTable
7a86a0fe-cd46-331e-595b-6be168091d0c
05/11/2019
medium

Range.LocationInTable property (Excel)

Returns a constant that describes the part of the PivotTable report that contains the upper-left corner of the specified range. Can be one of the following XlLocationInTable constants. Read-only Long.

Syntax

expression.LocationInTable

expression A variable that represents a Range object.

Example

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

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

[!includeSupport and feedback]