I have a scatter chart on a worksheet, called "chart1". In code, I'd like to set a reference to this chart so that I can adjust the axis boundaries.
This seems simple enough, but I can only seem to do so when first activating the chart. I need to instead set this chart to a variable
so that I do not lose whichever cell is currently selected.
So this works, but I lose the cell focus:
I instead want to do something like this, but am having no luck:
Thanks for any help.
This seems simple enough, but I can only seem to do so when first activating the chart. I need to instead set this chart to a variable
so that I do not lose whichever cell is currently selected.
So this works, but I lose the cell focus:
Code:
ActiveSheet.ChartObjects("chart1").Activate
ActiveChart.Axes(xlCategory).MinimumScale = 0
I instead want to do something like this, but am having no luck:
Code:
dim cht as Chart
set cht = sheets("sheet1").ChartObjects("chart1")
cht.Axes(xlCategory).MinimumScale = 0
Thanks for any help.