View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier[_7_] Jon Peltier[_7_] is offline
external usenet poster
 
Posts: 115
Default Can you query a graph?

Don -

To get the maximum on the Y axis:

ActiveChart.Axes(xlvalue, xlprimary).maxumumscale

To get the tick spacing:

ActiveChart.Axes(xlvalue, xlprimary).majorunit.

Compare maxumumscale and maximumscale - major unit to your data. If the
lower still exceeds your data, run sthg like this:

with activechart.axes(xlvalue, xlprimary)
.maxumumscale = .maximumscale - .majorunit
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Don Wiss wrote:

Sometimes (on the Y-Axis) Excel will give you an extra tick mark above and
beyond the tick above the highest data point. (An empty band.) I would
rather it not do this. Nor do I want to completely calculate and build the
scale myself. There is one instance where it would be nice if I could
automatically correct this. The data data never goes above 1. Can I query
the graph somehow and see what maximum tick value it plans to use, and if
greater than 1 change the max value to 1?

If I could also query the tick major unit, I could then see when it has the
empty band and set a maximum value to not include it.

Or is there some simple solution and a property I could set to not allow an
empty band?

Thnaks, Don <donwiss at panix.com.