返回一个常量,该常量描述包含指定区域左上角部分的
PivotTable 部分。可为以下
XlLocationInTable 常量之一。
Long 类型,只读。
语法
表达式.LocationInTable
表达式 一个代表 Range 对象的变量。
说明
XlLocationInTable 可为以下 XlLocationInTable 常量之一。
|
xlRowHeader |
xlColumnHeader |
xlPageHeader |
xlDataHeader |
xlRowItem |
xlColumnItem |
xlPageItem |
xlDataItem |
xlTableBody |
示例
本示例显示一个消息框,用以描述数据透视表中活动单元格所在的位置。
示例代码 |
Worksheets.Item("Sheet1").Activate()
let vate = ActiveCell.LocationInTable
switch(vate) {
case -4153:
MsgBox("Active cell is part of a row header")
break
case -4110:
MsgBox("Active cell is part of a column header")
break
case 2:
MsgBox("Active cell is part of a page header")
break
case 3:
MsgBox("Active cell is part of a data header")
break
case 4:
MsgBox("Active cell is part of a row item")
break
case 5:
MsgBox("Active cell is part of a column item")
break
case 6:
MsgBox("Active cell is part of a page item")
break
case 7:
MsgBox("Active cell is part of a data item")
break
case 8:
MsgBox("Active cell is part of the table body")
}
|