PivotFields and Item Names: Display On Messagebox

     

     

    Sub Loop_PivotField_Names_on_MSG_Box()
    InputSH
    Define_PivotTable
    MsgBox PV.PivotFields.Count
    For i = 1 To PV.PivotFields.Count
    MsgBox PV.PivotFields(i).Name
    Next
    End Sub


    Sub LoopThroughPivot_Items()
    InputSH
    Define_PivotTable
    MsgBox PV.PivotFields("Item").PivotItems.Count
    For i = 1 To PV.PivotFields("Item").PivotItems.Count
    MsgBox PV.PivotFields("Item").PivotItems(i).Name
    Next
    End Sub


    Sub Display_DataItems_Of_Particular_DataField()
    InputSH
    Define_PivotTable
    MsgBox PV.PivotFields("Zone").PivotItems.Count
    For FieldNumb = 1 To PV.PivotFields.Count
    If PV.PivotFields(FieldNumb).Name = "Zone" Then
    For ItemNumber = 1 To PV.PivotFields("Zone").PivotItems.Count
    MsgBox PV.PivotFields("Zone").PivotItems(ItemNumber).Name
    Next
    FieldIdentified = "Yes"
    End If
    If FieldIdentified = "Yes" Then
    Exit For
    End If
    Next
    End Sub

     

    Download The Workbook