lock size of plot frame within graph

naznorb

Board Regular
Joined
Nov 24, 2009
Messages
51
I've got some complicated dynamic charts for which the easiest solution was to overlay 2 or 3 identically-shaped charts, with various data appearing or disappearing depending on the output of form controls.

My problem is: the size of the plot frame changes when the data (and thus, labels) changes on the "bottom" chart. But since I've not got labels on the above charts, they don't change size, so the data becomes misaligned.

Wondering if there's an easy way to say: "You charts, you just stay the size you are." Haven't been able to find any simple formatting to do that. I'm open to code, I just don't know where to begin.

Many thanks!
JB
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
You can set the plot size with VBA. The easiest is to make a change to the data so that your charts are misalligned.
Now record a macro (Tools / Macro / record new macro).
Select the bottom chart and drag the border to the required position.
Stop the recording.
Go to the macro editor (Alt-F11), and there is the macro . Something like:
Code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 14/04/2010 by Sijpie
'
'
    ActiveChart.ChartArea.Select
    ActiveChart.PlotArea.Select
    Selection.Width = 686
End Sub

You can create a botton on your sheet (or on the chart) that is linked to this macro to run it whenever wanted.
 
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,921
Members
449,094
Latest member
teemeren

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