test for secondary axis befor running macro?

  • Thread starter Thread starter Hammer_757
  • Start date Start date
H

Hammer_757

Second question: In a macro that sets all the text properties on th
active chart the line

“ActiveChart.Axes(xlValue, xlSecondary).AxisTitle.Select”

Returns an error “method axis of object chart fail” if the active char
does not have a secondary axis. In this workbook some charts do an
some don’t. I could write two macros… but I’m sure there is a way t
make this work. I think what is needed is to write an “IF” statemen
that checks to see if a secondary axis exists and runs the process i
it exists and skips it if it doesn’t.

So far I have not been able to find a method (hope Im using the righ
term) to check if something exists

Any help will be greatly appreciated
Rober
 
You could add:
Second question: In a macro that sets all the text properties on the
active chart the line

“ActiveChart.Axes(xlValue, xlSecondary).AxisTitle.Select”

Returns an error “method axis of object chart fail” if the active chart
does not have a secondary axis. In this workbook some charts do and
some don’t. I could write two macros… but I’m sure there is a way to
make this work. I think what is needed is to write an “IF” statement
that checks to see if a secondary axis exists and runs the process if
it exists and skips it if it doesn’t.

So far I have not been able to find a method (hope Im using the right
term) to check if something exists
 
Sometimes it so simple and I just have to make it complicated :o

Thank you very much Debr
 
Back
Top