Y axys not properly displayed

F

Frank

Here is my routine:

Do Until .Axes(xlValue).MaximumScale - .Axes(xlValue).MajorUnit <
Application.Max(Cht_data)
..Axes(xlValue).MaximumScale = .Axes(xlValue).MaximumScale
- .Axes(xlValue).MajorUnit
Loop

Do Until .Axes(xlValue).MinimumScale + .Axes(xlValue).MajorUnit >
Application.Min(Cht_data)
..Axes(xlValue).MinimumScale = .Axes(xlValue).MinimumScale
+ .Axes(xlValue).MajorUnit
Loop

It works great except when Application.Max(Cht_data) is too close
to .Axes(xlValue).MaximumScale. Then the axis width is too large.

If I manually edit the axis and enter the same maximum number, then
the width is back to a standard width.

I’ve tried to use a variable instead or use this code

ActiveChart.Axes(xlValue).Select
With Selection
..MaximumScale = .MaximumScale (or alternatively .MaximumScale =
my_variable_maximum)
End With

It does not work.

I’ve googled my routine but it returned nothing.

Any thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top