Assign macros inside a chart

Sjodom

New Member
Joined
Jun 19, 2010
Messages
17
Hello,

I have a program that works pretty well, but I ran into this snag. I am looking to have a pre-defined shape copied into a newly created chart with a macro attached. So far, I have created the chart, copied the shape, and attempted to confirm the macro assignment, but the shape's macro states it is currently assigned to a [shapename]_Click, even when I try to manually change it...

Is there a way to get around this? I find it neat that the end user will not need to switch between the chart (located in its own sheet) to another tab without having to use the currently hidden tabs at the bottom.

applicable coding used:

Set SwitchCharts = ActiveSheet.Shapes("Chart Switch")
::code::
SwitchCharts.Copy
ActiveSheet.Paste
Selection.Caption = "Switch Charts"
Selection.OnAction = "Chart_to_Subjects"
::code::

Thank you!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,215,483
Messages
6,125,063
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top