Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Friend,
I want to add one columns in straight table using macro, one by one cell.
Does any one knows?
Thanks
This might not work in Ajax. Do you want to perform a calculation in the macro, or is it just there to decide whether to show or hide columns. You can show or hide columns using the conditional show on the dimensions and expressions, which can test for the value of a variable that can be set using buttons etc. without needing to use a macro.
If you want to do in a macro anyway, then the following code taken from the API Guide should help:
rem create new straight table and switch places of dimension columns
set chart = ActiveDocument.Sheets("Main").CreateStraightTable
chart.AddDimension "ProductType"
chart.AddDimension "ProductGroup"
chart.AddExpression "sum(Amount)"
You will want to access an existing chart instead of creating a chart as they have done on the set chart line.
set chart = ActiveDocument.GetSheetObject("CH01")
Where CH01 is the code on the chart's General properties.
You may also want this to delete columns:
chart.RemoveDimension 1
chart.removeExpression 1
Where the number parameter is the dimension or expression number (i.e. the order in which it is set up in the properties).
Jonathan
Thanks Jonathan for reply.
Actually i want to calculate that column dynamically one by one cell and then i want to add it into table.
The macro code I posted should help you with adding into a table. The calculations you want to perform were not discussed.
Jonathan