Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I wanted to create a macro that should reset the default settings of the fast type change. Because I have 3 charts in the fast change bar , combo and straight and I want the combo chart to be default in few of my tables and in few tables I want the bar chart.
This is because when ever I change my chart from one to another the change chart will be my default. so, I want the scenario mentioned above so that I can reset before I am deploying
Hi,
I create an example. A simple columns chart, with all the expresions of fast type change unselected. If you push button Chart, then the chart changes to line chart and select all values for fast type change.
I'll hope help it.
hi,
Look at this:
sub charts()
set chart = ActiveDocument.getsheetobject("OBJECT NAME")'.CreateBarChart
chart.AddDimension "DIMENSION NAME"
chart.AddExpression "EXPRESSION METRIC"
set p = chart.GetProperties
p.GraphLayout.FastChange.Bar = True
p.GraphLayout.FastChange.Line = true
p.GraphLayout.FastChange.Combo = true
p.GraphLayout.FastChange.Pie = true
p.GraphLayout.FastChange.Scatter = true
p.GraphLayout.FastChange.Straight = true
p.GraphLayout.FastChange.Pivot = false
p.ChartProperties.FastChangeInChart = FALSE
chart.SetProperties p
chart.SetChartType 4 'line
end sub
Regards
As per my knowledge it will create a new chart and assigning the dimensions and expression and what are the fast type chart are required that is given
chart.SetChartType 4
what the above line of code do
Hi,
You can use this line to put this type of char by default.
Regards,
Its not working I tested it and showing an error in adddimension line itself
could you explain me because this is my first macro
Hi,
Copy your code here, please
Hi,
I create an example. A simple columns chart, with all the expresions of fast type change unselected. If you push button Chart, then the chart changes to line chart and select all values for fast type change.
I'll hope help it.
It sets the chart type:
0 = bar chart
1 = pie chart
2 = pivot table
3 = scatter chart
4 = line chart
5 = straight table
6 = combo chart
Hi,
Then use this code in the line chart.SetChartType (insert the number of the chart to show)
Regards
Hi,
thats work fine but if I have more than 2 charts in my sheet and I want to reset to all the charts then what should I do