Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a way to change the label for a dimension in pivot table in a macro vbscript ? I have the right syntax to change the label for an Expression in a pivot table :
set props = summaryTable.getProperties | |
set expr = props.Expressions.Item(0).Item(0).Data.ExpressionVisual | |
expr.Label.v = "Sales $(vCurrentYear)" | |
expr.NumAdjust = 1 'center | |
expr.LabelAdjust = 1 'center |
summaryTable.SetProperties props |
How can I adapt to change the label of a dimension ?
Thanks in advance
The label of a dimension is a title:
set chart = ActiveDocument.Activesheet.CreateStraightTable
chart.AddDimension "ProductType"
chart.AddExpression "sum(Amount)"
chart.AddExpression "count(Customer)"
set cp = chart.GetProperties
set dims = cp.Dimensions
dims(0).Title.v = "Type of product"
chart.SetProperties cp