Рет қаралды 36,640
Using one table where the first column is the x values and every other column is the y values in their own charts.
Sub AddCharts()
Dim i As Integer 'rows
Dim j As Integer 'columns
i = Cells(Rows.Count, 1).End(xlUp).Row
For j = 2 To 4
With ActiveSheet.Shapes.AddChart.Chart
.ChartType = xlXYScatter
.SeriesCollection.NewSeries
With .SeriesCollection(1)
.Name = "=" & ActiveSheet.Name & "!" & _
Cells(1, j).Address
.XValues = "=" & ActiveSheet.Name & "!" & _
Range(Cells(2, 1), Cells(i, 1)).Address
.Values = "=" & ActiveSheet.Name & "!" & _
Range(Cells(2, j), Cells(i, j)).Address
End With
.HasLegend = False
End With
Next j
End Sub
Where I got the code from:
www.mrexcel.co...
Different chart types in excel vba: bettersolution...
---------------------------------------------------------------------------------
#exceltutorials #excelvba #excelcharts
SUBSCRIBE: goo.gl/c46YPs
Microsoft Office 365, 2016, Office Insider, Version 1909
These data are related to my PhD research
---------------------------------------------------------------------------------
IF YOU LIKED THIS VIDEO YOU MAY ALSO LIKE:
How to quickly make multiple charts in excel • How to quickly make mu...
How to make panel charts in excel - method 1 • How to make panel char...
How to make a dynamic chart using data validation • How to make a dynamic ...