Auto x range start value, xy charts

D

dougaj4

I have several Excel xy charts plotting data that updates
automatically.

The x range varies from 0 to 40, 40 to 80, ... up to 560 to 600.

I want the chart x values to start at the lowest x value in the data,
but it actually starts at 0 for all values up to 160, then does what I
want for higher x starting values.

I have the x axis auto button selected.

Can anyone tell me how to stop the minimum value defaulting to zero?
Excel 2003 and Windows XP.
 
D

Don Guillett

see if this idea helps

Sub setmin()
x = Application.Min(Range("d1:d12"))
Sheets("sheet4").ChartObjects("Chart 3"). _
Chart.Axes(xlValue).MinimumScale = x
End Sub

you may want to change x=
x=formulaarray."=MIN(IF(d1:d12>0,d1:d12))"
 
D

dougaj4

Thanks Don & Andy

Thanks for that, the macro will do what I want.

A little surprising that this functionality isn't built in though!
Doug Jenkins
 

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