View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default Help with graphs

Where is the code? In the worksheet module? This piece of code doesn't
respond to any changing values, it sets the major and minor unit (which set
the gridline spacing) to constant values.

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


"Ant" wrote in message
...
Hi. In a worksheet I have some code which automatically updates the
Gridlines
each time new source data is updated. It has been working fine however for
some reason now, it updates whilst going through the code, but when a cell
is
chosen outside the graph eg cell A8, it resorts back to the original
scale.
Code as follows:

With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 40000000
.MinorUnit = 200000
.MajorUnit = 5000000
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
Range("A8").Select

Can anyone see what is going wrong here and why the gridlines don't stay
on
the scale above?

Cheers.