Manuel -
Can you put both series into the same chart, and use secondary axes for
one of the series?
Otherwise you need a macro. Here's one I've used to make the width and
height of the plotting rectangles of all charts the same size:
Sub AllTheSameInside()
'' Select a chart, then run
Dim cht As Chart
Dim chtob As ChartObject
Dim chtobHt As Double
Dim chtobWd As Double
Dim chtobLf As Double
Dim chtobTp As Double
Dim pltarHt As Double
Dim pltarWd As Double
Dim pltarLf As Double
Dim pltarTp As Double
Dim pltarInRt As Double
Dim pltarInBt As Double
Dim pltarInHt As Double
Dim pltarInWd As Double
Dim pltarInLf As Double
Dim pltarInTp As Double
If Not ActiveChart Is Nothing Then
ActiveWindow.Visible = False
End If
'' Hide the action to prevent dizziness
'' and speed it up dramatically
Application.ScreenUpdating = False
'' Cycle through charts on worksheet to get parameters
For Each chtob In ActiveSheet.ChartObjects
With chtob.Chart
'' Get extreme plotarea inside parameters
pltarInHt = WorksheetFunction.Min(pltarInHt, _
.PlotArea.InsideHeight)
pltarInLf = WorksheetFunction.Max(pltarInLf, _
.PlotArea.InsideLeft)
pltarInTp = WorksheetFunction.Max(pltarInTp, _
.PlotArea.InsideTop)
pltarInWd = WorksheetFunction.Min(pltarInWd, _
.PlotArea.InsideWidth)
pltarInRt = WorksheetFunction.Max(pltarInRt, _
.ChartArea.Width - .PlotArea.InsideLeft - _
.PlotArea.InsideWidth)
pltarInBt = WorksheetFunction.Max(pltarInBt, _
.ChartArea.Height - .PlotArea.InsideTop - _
.PlotArea.InsideHeight)
End With
Next
'' Cycle through charts on worksheet to set parameters
For Each chtob In ActiveSheet.ChartObjects
With chtob
'' Get initial position
chtobLf = .Left
chtobTp = .Top
'' Move to avoid XL97 PlotArea problems
.Left = ActiveSheet.Columns _
(ActiveWindow.ScrollColumn).Left + 10
.Top = ActiveSheet.Rows _
(ActiveWindow.ScrollRow).Top + 10
'' Fix Font Size
.Chart.ChartArea.AutoScaleFont = False
'' '' Apply chart object size
'' .Width = chtobWd
'' .Height = chtobHt
'' Apply plotarea parameters
With .Chart
'' Determine parameters
pltarLf = .PlotArea.Left + pltarInLf - _
.PlotArea.InsideLeft
pltarTp = .PlotArea.Top + pltarInTp - _
.PlotArea.InsideTop
pltarWd = .PlotArea.Width - _
(pltarInLf - .PlotArea.InsideLeft) - _
(pltarInRt - (.ChartArea.Width - _
.PlotArea.InsideLeft - .PlotArea.InsideWidth))
pltarHt = .PlotArea.Height - _
(pltarInTp - .PlotArea.InsideTop) - _
(pltarInBt - (.ChartArea.Height - _
.PlotArea.InsideTop - .PlotArea.InsideHeight))
With .PlotArea
'' Shrink it so it can move anywhere
.Height = pltarHt / 3
.Width = pltarWd / 3
.Top = pltarTp
.Left = pltarLf
.Height = pltarHt
.Width = pltarWd
End With
End With
'' Move back to initial position
.Left = chtobLf
.Top = chtobTp
End With
Next
'' Unhide the action
Application.ScreenUpdating = True
End Sub
- Jon