Change the maximum value of a chart's x-axis

jbpowell
jbpowell used Ask the Experts™
on
How can I set the maximum value for a chart's x axis in VB?

Say the chart is named 'Chart1' and it's a line graph.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
dsegard seems to have answered this in an earlier question at:

http://www.experts-exchange.com/Databases/MS_Access/Q_10184231.html
---------------------
His answer is:

[ReferenceOfYourChart].Object.Application.Chart.axes(2).maximumscale = VALUE

You can also place a date for time scale.

Download Grphsm97.exe from
http://support.microsoft.com/support/downloads/LNP126.asp
It contains a lot of VBA sample to manipulate graph.
-------------------


My comment is that you may need to use (1) and not (2) in order to address the x axis versus the y axis.


Robert

Commented:
Chart1.Object.Axes(xlValue).MaximumScale = x

Depending on the orientation of your graph you may wany xlCategory instead of xlValue.

Author

Commented:
This worked great, thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial