How do I change a Chart's axis scale from visual basic?

G

Guest

How do I change a Chart's (that is on a worksheet) x-axis scale from visual
basic?

The following only works when the chart has its own sheet/tab.
With Charts("Chart1").Axes(xlCategory)
.MinimumScale = 740.25
.MaximumScale = 746.25
End With

If it is located within a worksheet how do you reference it?
 
A

Andy Pope

Hi,

Some more like this for chartobject,

With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory)
.MinimumScale = 740.25
.MaximumScale = 746.25
End With

Cheers
Andy
 
G

Guest

Thanks a bunch.
Excellent.
John

Andy Pope said:
Hi,

Some more like this for chartobject,

With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory)
.MinimumScale = 740.25
.MaximumScale = 746.25
End With

Cheers
Andy
 

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