Using Excel 2010. I have a table of data and a chart reflecting that data. The macro below follows the process of adjusting the minimum and maximum values of the "x" axis to -2.5 min. and 2.5 max. and the "y" axis to -3.5 min. and 3.5 max. How do I reference a cell value for the min. and max. in each case rather than the fixed values of -2.5 and 2.5 etc. That is, I want to put the min. and max values in a cell in the worksheet and have them utilized as the axis values. Any help would be greatly appreciated.
Sub xyPlane_XandY_Axis()
ActiveSheet.Shapes.Range(Array("Group 6")).Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.HasAxis(xlValue) = True
ActiveChart.Axes(xlCategory).Select
ActiveChart.Axes(xlCategory).MinimumScale = -2.5
ActiveChart.Axes(xlCategory).MaximumScale = 2.5
ActiveChart.HasAxis(xlValue) = True
ActiveChart.Axes(xlValue).Select
ActiveChart.Axes(xlValue).MinimumScale = -3.5
ActiveChart.Axes(xlValue).MaximumScale = 3.5
End Sub
Sub xyPlane_XandY_Axis()
ActiveSheet.Shapes.Range(Array("Group 6")).Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.HasAxis(xlValue) = True
ActiveChart.Axes(xlCategory).Select
ActiveChart.Axes(xlCategory).MinimumScale = -2.5
ActiveChart.Axes(xlCategory).MaximumScale = 2.5
ActiveChart.HasAxis(xlValue) = True
ActiveChart.Axes(xlValue).Select
ActiveChart.Axes(xlValue).MinimumScale = -3.5
ActiveChart.Axes(xlValue).MaximumScale = 3.5
End Sub