Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a way to set an expression's format in a Dynamic Chart Macro that will basically follow the "Expression Default" option available on the Chart Properties Number Tab.
I am currently using the ..Data.ExpressionVisual.NumberPresentation.fmt = '#,##0' syntax and would like the expression format to default from the expressions that include Num(sum(Amount),'#,##0') syntax....
Thanks in advance.
Hi Greg,
Check the below attachment.
Hi ,
May be like this,
Sub CreateLineChart
set chart = ActiveDocument.Sheets("Main").CreateLineChart
chart.AddDimension "ID"
chart.AddExpression "sum(Amount)"
set p = chart.GetProperties
p.Expressions.Item(0).Item(0).Data.AxisData.Units.Unit.v = "$"
p.Expressions.Item(0).Item(0).Data.AxisData.Units.kUnit.v = "1000$"
p.Expressions.Item(0).Item(0).Data.AxisData.Units.MUnit.v = "million$"
p.Expressions.Item(0).Item(0).Data.AxisData.Units.GUnit.v = "billion$"
chart.SetProperties p
end Sub
Hope this helps,
Regards,
Hirish