Hi opsinmena,
The following code will set the primary axis of Chart 1 to the values defined in the named ranges Ymax, Ymin, Ymajor and Yminor. If you assign that code to a button, you can specify or calculate your axis settings in the respective named ranges, then click the button to apply these numbers to both axes in one click.
If you have several charts on the sheet, you may need to adjust the macro to pick the correct chart. To find out the chart name, select a cell in your worksheet, then hold down the Ctrl key and select the chart. You will now see the chart name in the name box above cell A1.
The code goes into a regular code module.
Bookmarks