Add a change event to change charts from different sheet

erickguz

Board Regular
Joined
May 11, 2010
Messages
58
I downloaded vba code that changes the y axis on my graphs from spreadsheet guru. It's great for my forex charts, etc.

They provide code for a worksheet change event that allows the charts to change once a cell is changed.

I right clicked on each tab and then under "view code", entered the following code as worksheet_change event. Works great.

Is there a way to update all charts, on the many different sheets, from just one cell on the first sheet1? I've tried but have been unable to figure it out.

Following is the code:

Private Sub Worksheet_Change(ByVal Target As Range)
'PURPOSE: Run AdjustVerticalAxis macro when Cell C2 is changed

If Target = Range("C2") Then Call AdjustVerticalAxis

End Sub


Again, it updates the chart after I change data in cell C2 for each sheet. I would like to have the charts updated on all sheets without me having to either enter data into each sheet. By default, the original macro updates all charts on one sheet after you left click on any chart on that sheet.

Thanks.
Erick
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,214,834
Messages
6,121,871
Members
449,054
Latest member
juliecooper255

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