LocationInTable 属性 - Microsoft Excel Visual Basic 2002 参考

返回介绍

LocationInTable 属性

发布于 2019-08-07 字数 1447 浏览 772 评论 0

返回一个常量,该常量描述包含指定区域左上角区域的数据透视表的一部分。可为以下 XlLocationInTable 常量之一。Long 类型,只读。





XlLocationInTable 可为以下 XlLocationInTable 常量之一。
xlRowHeader
xlColumnHeader
xlPageHeader

xlDataHeader

xlRowItem

xlColumnItem

xlPageItem

xlDataItem

xlTableBody


示例


本示例显示一个消息框,用以描述数据透视表中活动单元格所在的位置。


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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

支持 Markdown 语法,需要帮助?

目前还没有任何评论,快来抢沙发吧!