Duplicating use of buttons/macros over many charts

  • Thread starter Thread starter Neil
  • Start date Start date
N

Neil

Hi All (again),

I intend to fit out my spready containing 8 charts with a button linked to a
macro that does the following:

If the text on the button is "Above", the macro will apply data values to
the chart above the series line in question and change the button text to
"Below".
Clicking it in this state will apply data values to the series below the
series line in question and change the button text to "Off".

I have this all working now for one chart, however I would like to know the
best way to transfer it to the other 7 charts.

If I simply copy the buttons to another chart, the button 'name' changes ie.
Button67 becomes Button81.

This kills the macro as I currently refer to the button by name.

Any suggestions as to how to make efficient use of the one macro structure
across all 8 charts.

Thanks,

Neil
 
You could use something like this that avoids the name problem:



dim myBtn as button
set myBtn = activesheet.buttons(application.caller)

If LCase(myBtn.Caption) = .... then
 
Back
Top