derthorsten
New Member
- Joined
- Jul 13, 2015
- Messages
- 7
Hi,
I cant find a solution to the following problem:
I have a macro that creates a chart from data with one series "total". Its not the most efficient piece of code I guess but it does the job (if you have an idea how to shorten the code be by guest ).
yy_total is my complete data range consisting of 2 columns with X and Y values.
How can I add a second series to the chart? All my attempts have failed so far
I cant find a solution to the following problem:
I have a macro that creates a chart from data with one series "total". Its not the most efficient piece of code I guess but it does the job (if you have an idea how to shorten the code be by guest ).
yy_total is my complete data range consisting of 2 columns with X and Y values.
Code:
Charts.Add
With ActiveChart
.ChartType = xlLine
.HasTitle = True
.HasLegend = False
.ChartTitle.Text = "YY Total"
.SetSourceData Source:=yy_total
.Location Where:=xlLocationAsObject, Name:=ShName1
End With
With ActiveChart.Axes(xlCategory)
.TickLabels.NumberFormat = "MMMMM/YY"
End With
With ActiveChart.Axes(xlValue)
.MaximumScale = max_yytotal + 1000
.MinimumScale = min_yytotal - 1000
End With
With ActiveChart.Parent
.Top = Cells(4, 6).Top
.Left = Cells(4, 6).Left
End With
How can I add a second series to the chart? All my attempts have failed so far