使用Excel2010,我正在尝试使用几个不同表中的部分数据在Sheet1上创建图表。在下面的示例中,我只是尝试从一个表中提取数据作为开始。我似乎很难在此表中设置此数据的范围。
我最终将遍历每个表大约8个不同长度的数据列。21张桌子。所以任何自动化的帮助都是很棒的
这就是我目前所知道的..。
Sub createChart()
Dim rng As Range
Dim chrt As Object
'Table is named BMS_01_01_Module_01 and the column Name I want data from is Cell 1 Voltage
Set chrt = Sheet1.Shapes.AddChart2
chrt.ChartArea.SetSourceData Source:=activesheetlistobjects("BMS_01_01_Module_01").ListColumns("Cell 1 Voltage").Range
chrt.ChartArea.ChartType = x1Line
End Sub
https://stackoverflow.com/questions/52748120
复制相似问题