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 :
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
--------------------------------------------------------------------------------------------------------
Thanks, TAMATAM ; Business Intelligence & Analytics Professional
--------------------------------------------------------------------------------------------------------
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.