我想使用有效范围作为图表的源数据。
Range("D2").Select
Selection.FormulaR1C1 = "=RC[-1]*0.9"
Selection.Copy
ActiveCell.Offset(0, -1).Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
ActiveSheet.Shapes.AddChart2(201, xlColumnClustered).Select
ActiveChart.SetSourceData Source:=Range(Selection)
尽管excel创建了图表,但出现错误。