Microsoft KB Archive/124003

= Microsoft Knowledge Base =

XL: Chart Not Resized Automatically When Legend Moved
Last reviewed: June 4, 1997

Article ID: Q124003

5.00 5.00c 7.00 | 5.00

WINDOWS        | MACINTOSH kbprg kbcode

The information in this article applies to:


 * Microsoft Excel for Windows, versions 5.0, 5.0c
 * Microsoft Excel for the Macintosh, version 5.0
 * Microsoft Excel for Windows NT, version 5.0
 * Microsoft Excel for Windows 95, version 7.0

SYMPTOMS
In Microsoft Excel, after you create a chart with a legend, or when you add a legend to a chart and then delete or move it, the chart is not automatically resized to fill the entire usable area.

Note that this behavior is different from earlier versions of Microsoft Excel. In earlier versions of Microsoft Excel, the chart is automatically resized to fill in the gap where the legend was previously positioned.

WORKAROUNDS
To work around this problem, use any of the methods below.

Method 1: Resize the chart manually by clicking in the plot area and then

dragging its border to the desired size. Method 2: Use an autoformat to reformat the chart. To do this, choose

Autoformat from the Format menu.

Note that if you use this method, you may remove the original formatting from your chart. Method 3: To resize the chart in a macro, use the appropriate code

below:

To resize the chart to its maximum width

ActiveChart.Plotarea.Left = ActiveChart.ChartArea.Left ActiveChart.PlotArea.Width = ActiveChart.ChartArea.Width

To resize the chart to its maximum height -

ActiveChart.PlotArea.Top = ActiveChart.ChartArea.Top ActiveChart.PlotArea.Height = ActiveChart.ChartArea.Height