作者cos145 (more)
看板Visual_Basic
标题[VBA ] 自动叠图
时间Mon Jun 10 23:25:32 2019
我有一串资料如下
A B C D E
1 星期 数量1 数量2 数量3
2 1 10 10 1
3 2 20 20 2
4 3 30 30 44
5 4 40 20 55
6 5 80 10 66
7 6 30 20 55
我使用绘制XY折线图录制巨集
X轴是星期 第一数列是数量1 第二数列是数量2
当我新增数列数量3时,我想要启动VBA自动抓值
Dim i As integer
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(1).Name = "=Sheet1!$B$1"
ActiveChart.FullSeriesCollection(1).XValues = "=Sheet1!$A$2:$A$7"
ActiveChart.FullSeriesCollection(1).Values = "=Sheet1!$B$2:$B$7"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(2).Name = "=Sheet1!$C$1"
ActiveChart.FullSeriesCollection(2).XValues = "=Sheet1!$A$2:$A$7"
ActiveChart.FullSeriesCollection(2).Values = "=Sheet1!$C$2:$C$8"
我想请问,这个回圈i该怎麽加入上述程式集里
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 110.50.145.188 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Visual_Basic/M.1560180334.A.198.html