Set Min and Max Axis in a Line Graph

trainer75

New Member
Joined
Jun 11, 2015
Messages
31
Hi,
wonder if anyone could assist, I have created numerous data sets that with be selected by a drop down box and would like to present a line graph, but the as with the variable I would like the graph to automatically adjust the min and max axis so it looks cleaner and easier to read.

I have created 2 cells, one with the MIN value from the range and the other with the MAX value from the range (these change when selecting different data from drop down box) and would like the axis to reference these.

is this do-able?

Thank you in advance

Regards,
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

sijpie

Well-known Member
Joined
Nov 1, 2008
Messages
3,734
You can use the following as a basis on how to set the min and max:
VBA Code:
    ActiveChart.Axes(xlCategory).MinimumScale = 0.5
    ActiveChart.Axes(xlCategory).MaximumScale = 5.8

Substitute the values above with the relevant cell values .

Let me know if you need more help on this.
in that case please post the code you have so far to set the graphs and an image of the data sheet
 

Watch MrExcel Video

Forum statistics

Threads
1,122,587
Messages
5,597,034
Members
414,116
Latest member
sfullnet

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
Top