Formatting an Excel graph/chart automatically using VBA code

MassSpecGuru

Board Regular
Joined
Feb 23, 2010
Messages
55
I need to plot some laboratory data to determine the upper and lower warning and control limits for a particular analysis method. I have already have one graph set up for the low quality control (QC) sample, however, when I use the same chart to plot the high QC sample results the y-axis scale is too small.

Is there a way using some VBA code to have all of the control charts automatically scale the y-axis to prescribed upper and lower values?

For example, plotting the results of 20 separate analysis on a scatter chart gives 20 data points centered around, say, 100ppm, with a standard deviation (SD) of, say, +/-5ppm. I would like the y-axis to be scaled automatically to display from -4SD to +4SD. That is to say, from 80 to 120ppm.

Any input would be greatly appreciated.

Thanks
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,215,515
Messages
6,125,279
Members
449,220
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top