CubeFieldType Property

Microsoft Excel Visual Basic

Show All

CubeFieldType Property

       

Indicates whether the OLAP cube field is a hierarchy field or a measure field. Can be one of the following XlCubeFieldType constants: xlHierarchy or xlMeasure. Read-only XlCubeFieldType.

Example

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

Set objNewSheet = Worksheets.Add
objNewSheet.Activate
intRow = 1
For Each objCubeFld in Worksheets("Sheet1").PivotTables(1).CubeFields
    If objCubeFld.CubeFieldType = xlMeasure Then
        objNewSheet.Cells(intRow, 1).Value = objCubeFld.Name
        intRow = intRow + 1
    End If
Next objCubeFld