Tuesday, March 22, 2016

How to Know the Pivot Field Orientation in Excel Pivot Table with VBA

Excel VBA to get the Pivot Field Orientation in a Pivot Table
Sub Pvt_Fields_Orientation()

Dim Pvt As PivotTable
Dim Pvt_Field As PivotField

Set Pvt = ActiveSheet.PivotTables("MyPivot")

For Each Pvt_Field In Pvt.PivotFields

MsgBox Pvt_Field.Name
MsgBox Pvt_Field.Orientation
'0-xlDataField (Values Section)
'1-xlRowField (Row Section)
'2-xlColumnField (Column Section)
'3-xlPageField (Filter Section )

Next Pvt_Field

End Sub

Example :



--------------------------------------------------------------------------------------------------------
Thanks, TAMATAM ; Business Intelligence & Analytics Professional
--------------------------------------------------------------------------------------------------------

No comments:

Post a Comment

Hi User, Thank You for visiting My Blog. If you wish, please share your genuine Feedback or comments only related to this Blog Posts. It is my humble request that, please do not post any Spam comments or Advertising kind of comments, which will be Ignored.

Featured Post from this Blog

How to compare Current Snapshot Data with Previous Snapshot in Power BI

How to Dynamically compare two Snapshots Data in Power BI Scenario: Suppose we have a sample Sales data, which is stored with Monthly Snapsh...

Popular Posts from this Blog