Changing a scale range in a graph

gage25

New Member
Joined
Oct 16, 2002
Messages
16
I have some data which will be graphed using a macro. The data is in a dynamic named range. The data is pulled from another database and then dumped into the spreadsheet. A macro then builds the graph.

How do I change the scale on the graph to reflect the high and low values of the new data? For instance, if the new data contains a high number of 1.899 and a low number of 1.755, then the Y-axis scale of the graph will change to reflect the new high and low numbers. This scale will need to change every time new data is pulled in to match the new data.

Is there a way to achieve this?

Thanks.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

gage25

New Member
Joined
Oct 16, 2002
Messages
16
Thanks! But what I am trying to accomplish is to insert the code to do this through the graph macro. I want the macro to determine the high and low values and adjust the scale depending on the values that are in the data columns.

Thanks again.
 

plettieri

Well-known Member
Joined
Sep 4, 2002
Messages
1,556
Platform
  1. MacOS
sorry gage25 i realized just after i sent my post that you were looking for some code rather than the std process...

pll
 

Phil_Ridley

New Member
Joined
Mar 7, 2002
Messages
1
Hi all,
Could you tell me the standard process ?
I have a range of data that changes and I want the chart to size itself to the data.

Thanks,
Phil.
 

plettieri

Well-known Member
Joined
Sep 4, 2002
Messages
1,556
Platform
  1. MacOS
Sure ...try this

on the graph right click the vertical axis,format axis, scale, then pick your choices for first 4 check boxes (min,max,etc.)


pll
 

Forum statistics

Threads
1,144,209
Messages
5,723,039
Members
422,476
Latest member
beck85

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