ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Y axys not properly displayed (https://www.excelbanter.com/excel-programming/443189-y-axys-not-properly-displayed.html)

Frank[_28_]

Y axys not properly displayed
 
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?


All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com