Expand Minimize
0 out of 1 rated this helpful - Rate this topic

PivotTable.CubeFields Property (Excel)

Returns the CubeFields collection. Each CubeField object contains the properties of the cube field element. Read-only.

expression .CubeFields

expression A variable that represents a PivotTable object.

This example creates a list of cube field names for the data fields in the first OLAP-based PivotTable report on Sheet1.

Set objNewSheet = Worksheets.Add 
intRow = 1 
For Each objCubeFld In Worksheets("Sheet1").PivotTables(1).CubeFields 
 If objCubeFld.Orientation = xlDataField Then 
 objNewSheet.Cells(intRow, 1).Value = objCubeFld.Name 
 intRow = intRow + 1 
 End If 
Next objCubeFld

Community Additions

© 2014 Microsoft. All rights reserved.