軟體:excel
版本:2007
以下為我錄製的巨集程式碼
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatter
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "='6點配置與借車'!$A$2"
ActiveChart.SeriesCollection(1).XValues = "='6點配置與借車'!$E$2:$E$185"
ActiveChart.SeriesCollection(1).Values = "='6點配置與借車'!$H$2:$H$185"
Range("N6").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatter
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "='6點配置與借車'!$A$186"
ActiveChart.SeriesCollection(1).XValues = "='6點配置與借車'!$E$186:$E$369"
ActiveChart.SeriesCollection(1).Values = "='6點配置與借車'!$H$186:$H$369"
End Sub
圖表標題固定為A2 A186 (等差184)
圖表資料範圍固定為E2:E185
下一張圖表資料範圍固定為E186:E369(等差也為184)
共34張圖表需要繪設
請問欄位那邊 怎麼利用迴圈方式取代,可以讓他自己繪圖
有試用過
for i = 2 to 6256 step183
"='6點配置與借車'!$J$2:$J$185" 寫成=” '6點配置與借車'!$H$"&i&:i+183
但還是跑不出來,請問有大大可以幫忙解惑 或是指點一下嗎?