title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
CubeField object (Excel) |
vbaxl10.chm667072 |
|
|
6db16910-6c27-651a-c388-e54e27fe4519 |
03/29/2019 |
medium |
Represents a hierarchy or measure field from an OLAP cube. In a PivotTable report, the CubeField object is a member of the CubeFields collection.
Use the CubeField property of the PivotField object to return the CubeField object. This example creates a list of the cube field names for all the hierarchy fields in the first OLAP-based PivotTable report on Sheet1.
Set objNewSheet = Worksheets.Add
objNewSheet.Activate
intRow = 1
For Each objPF in _
Worksheets("Sheet1").PivotTables(1).PivotFields
If objPF.CubeField.CubeFieldType = xlHierarchy Then
objNewSheet.Cells(intRow, 1).Value = objPF.Name
intRow = intRow + 1
End If
Next objPF
Use CubeFields (index), where index is the cube field's index number, to return a single CubeField object. The following example determines the name of the second cube field in the first PivotTable report on the active worksheet.
strAlphaName = _
ActiveSheet.PivotTables(1).CubeFields(2).Name
- AllItemsVisible
- Application
- Caption
- Creator
- CubeFieldSubType
- CubeFieldType
- CurrentPageName
- DragToColumn
- DragToData
- DragToHide
- DragToPage
- DragToRow
- EnableMultiplePageItems
- FlattenHierarchies
- HasMemberProperties
- HierarchizeDistinct
- IncludeNewItemsInFilter
- IsDate
- LayoutForm
- LayoutSubtotalLocation
- Name
- Orientation
- Parent
- PivotFields
- Position
- ShowInFieldList
- TreeviewControl
- Value
[!includeSupport and feedback]