Turn on secondary axis

  • Thread starter Thread starter Edward Ulle
  • Start date Start date
E

Edward Ulle

I've search and tried everything I can think of to turn on the secondary
axis. I've even recorded a macro to see what Excel does but no luck.

Set c = Charts.Add
With c
.HasAxis(xlValue, xlSecondary) = True
.Axes(xlValue, xlSecondary).CategoryType = xlAutomatic
End With


I get "Method 'Axes' of objecty '_Chart' failed".

What am I doing wrong?
 
Sorry folks. I figured it out.

I guess you can't have a secondary axis until you have one or maybe
multiple series in your chart.

I moved the code down after the series were created and voila it works.
 
You need at least two series, one for the primary axis, the other for the
secondary.

- Jon
 

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

Back
Top