Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
how can i do "Pivoting" in VBScript macro?
that means that for example, i have created a PivotTable with two dimensions in my macro and then i need to send one of this dimensions on horizontal axis.
Best regards
Peyman
I have found the correct answer. It's like this :
SUB mySUB
SET chart = ActiveDocument.Activesheet.CreatePivotTable
chart.AddDimension "Product"
chart.AddDimension "Year"
chart.AddExpression "sum(Amount)"
cp = chart.GetProperties
cp.TableProperties.NumberOfLeftDimensions = 1
chart.SetProperties cp
END SUB
I have found the correct answer. It's like this :
SUB mySUB
SET chart = ActiveDocument.Activesheet.CreatePivotTable
chart.AddDimension "Product"
chart.AddDimension "Year"
chart.AddExpression "sum(Amount)"
cp = chart.GetProperties
cp.TableProperties.NumberOfLeftDimensions = 1
chart.SetProperties cp
END SUB