我已经录制了这个宏。它用于插入图表。如何创建图表形状并将其签名到变量以供以后参考?我想将变量传递给范围。我只想更改(52)号。所以如果变量是row
我如何在下面的代码中使用它。我试过这个
("'Simpson'!$K$3:$L$row")
但它不起作用
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Simpson'!$K$3:$L$52")
ActiveChart.ChartType = xlXYScatterSmooth
ActiveChart.ChartTitle.Select
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.ChartTitle.Text = "integrated function chart"
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.Axes(xlValue).Select
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleHorizontal)
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = "x values"
ActiveSheet.ChartObjects("Chart 5""""").Activate
'How can I delete the legend in one. combining the next two
ActiveChart.Legend.Select
Selection.Delete