請問各位專家,我要產出ABCD各自的圖表,目前寫出來的語法只能匯出A的資料,
BCD要如何同時匯出? 請指教 謝謝。
Sub Output()
Dim xChart As ChartObject
Selection.AutoFilter
ActiveSheet.Range("DB!$A:$D").AutoFilter Field:=1, Criteria1:="A"
ActiveSheet.Shapes.AddChart2(227, xlLine).Select '折線圖
Set xChart = ActiveSheet.ChartObjects(1)
With xChart
.Top = 40
.Left = 460
'.Width = 200
'.Height = 200
ActiveChart.SetSourceData Source:=Range("DB!$A:$D") '資料範圍
ActiveChart.FullSeriesCollection(1).XValues = "=DB!$D:$D" 'Y軸
ActiveChart.ChartTitle.Select
ActiveChart.Axes(xlValue).MaximumScale = 60 '最大值
ActiveChart.Axes(xlValue).MajorUnit = 5 '間距
Application.CutCopyMode = False
End With
End Sub