derthorsten
New Member
- Joined
- Jul 13, 2015
- Messages
- 7
Hi,
I m stuck on a project and would appreciate some help. Currently my macro adds a chart with one series. It works fine, although I guess there is a way to program more efficiently (would be nice to know how ).
How do I add a second series that shares the same Y-Values (Dates) as the existing series? If I declare a name "test" and code sth like
Any idea?
Many thanks!
I m stuck on a project and would appreciate some help. Currently my macro adds a chart with one series. It works fine, although I guess there is a way to program more efficiently (would be nice to know how ).
Code:
ws_data.Activate
With ActiveSheet
Set total = .Range("A11:A" & LastRow & ", T11:T" & LastRow)
Charts.Add
With ActiveChart
.ChartType = xlLine
.HasTitle = True
.HasLegend = False
.ChartTitle.Text = "Total"
.SetSourceData Source:=total
.Location Where:=xlLocationAsObject, Name:=ShName1
End With
With ActiveChart.Axes(xlCategory)
.TickLabels.NumberFormat = "MMMMM/YY"
End With
With ActiveChart.Axes(xlValue)
.MaximumScale = max_total + 1000
.MinimumScale = min_total - 1000
End with
With ActiveChart.Parent
.Top = Cells(4, 10).Top
.Left = Cells(4, 10).Left
End With
How do I add a second series that shares the same Y-Values (Dates) as the existing series? If I declare a name "test" and code sth like
Code:
With ActiveChart.SeriesCollection.NewSeries
.Name = "Test"
.SetSourceData = test
End with
Any idea?
Many thanks!