0
我在工作簿中有几张工作表。每张表格包含具有相同格式的测试结果。我想创建一个宏,它在每张工作表中创建一个图表,只绘制来自该工作表的数据。这一步我已经得到了:使用活动工作表中的单元格值命名图表
Sub Macro()
Dim sSheetName As String
sSheetName = ActiveSheet.Name
Sheets(sSheetName).Select
Range("G7:I5241").Select 'range to plot
Range("K7").Select 'location of plot
ActiveSheet.Shapes.AddChart2(240, xlXYScatterSmoothNoMarkers).Select 'select plot type
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(1).Name = "='sSheetName'!R1C2" 'attempting to name the plot by a cell value in the active sheet
但是,最后这句话是不是成功地创造活动工作表的链接单元R1C2。
截图:
任何想法?