lalalisa
Thành viên mới
- Tham gia
- 17/4/23
- Bài viết
- 1
- Được thích
- 0
Sub a()
Dim chrt As Chart, i As Long
For i = 1 To 5
Set chrt = ActiveSheet.Shapes.AddChart2(201, xlColumnClustered, 100 + (i - 1) * 500, 50, 400, 300).Chart
With chrt
.SetSourceData Source:=Range("a1:b10")
.SeriesCollection(1).ChartType = xlLine
.SeriesCollection(1).AxisGroup = 1
With .SeriesCollection.NewSeries
.Values = Range("b2:b10").Offset(, i)
.Name = [c1].Offset(, i)
.ChartType = xlColumnClustered
.AxisGroup = 1
End With
End With
Next
End Sub
Dim chrt As Chart, i As Long
For i = 1 To 5
Set chrt = ActiveSheet.Shapes.AddChart2(201, xlColumnClustered, 100 + (i - 1) * 500, 50, 400, 300).Chart
With chrt
.SetSourceData Source:=Range("a1:b10")
.SeriesCollection(1).ChartType = xlLine
.SeriesCollection(1).AxisGroup = 1
With .SeriesCollection.NewSeries
.Values = Range("b2:b10").Offset(, i)
.Name = [c1].Offset(, i)
.ChartType = xlColumnClustered
.AxisGroup = 1
End With
End With
Next
End Sub