Chart & Visualization Issues

Apply Size and Aspect Ratio Properties to Multiple Excel Charts

Emma BrownEmma Brown Nov 14, 2026 872 views

Question details

The user wants to change properties and lock the aspect ratio of multiple Excel charts without editing each one separately.

Apply Size and Aspect Ratio Properties to Multiple Excel Charts
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains multiple charts that need consistent size settings.
Observed behavior
The user wants chart properties applied to multiple chart objects at once.
Before you start

Identify the worksheet and charts you want to update. If you use the macro below, it will affect every embedded chart on the active worksheet.

Solution 1Recommended

Use a VBA macro to update all charts on a worksheet

Use this method in desktop Excel to lock the aspect ratio and set a common width for every embedded chart on the active worksheet.

The macro works with embedded charts on the active worksheet, not separate chart sheets. Locking the aspect ratio preserves each chart's existing proportions, so charts may have different heights after being given the same width.

1
Open the worksheet

In desktop Excel, select the worksheet containing the charts you want to change.

2
Open the VBA editor

Open the Developer tab and select Visual Basic, then choose Insert > Module in the VBA editor.

3
Add the macro

Paste this code into the module: Sub ResizeWorksheetCharts() Dim co As ChartObject For Each co In ActiveSheet.ChartObjects co.ShapeRange.LockAspectRatio = msoTrue co.ShapeRange.Width = Application.InchesToPoints(5) Next co End Sub

4
Set the desired width

In the line containing InchesToPoints(5), replace 5 with the desired width in inches. Delete that line if you only want to lock the aspect ratios without resizing the charts.

5
Run the macro

Return to the target worksheet, select Developer > Macros, choose ResizeWorksheetCharts, and select Run. Check several charts to confirm the result.

Use a VBA macro to update all charts on a worksheet
Macro availability: Excel for the web cannot run VBA macros. Run this code in desktop Excel, and only enable macros in files you trust.
Free Microsoft Office alternative

Work with spreadsheet charts in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Excel-format spreadsheets. It can help you migrate your spreadsheet work, but it does not change Microsoft Excel's chart settings.

Create and format charts in WPS SpreadsheetsOpen and edit Microsoft Excel XLS and XLSX filesUse a familiar spreadsheet interface for an easier transitionWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Can I lock the aspect ratio without changing chart sizes?

Yes. In the VBA macro, remove the line that sets ShapeRange.Width, then run the macro from Developer > Macros. It will lock the aspect ratio of each embedded chart without setting a new width.

Will the macro change charts on other worksheets?

No. The macro uses ActiveSheet.ChartObjects, so it changes only embedded charts on the worksheet that is active when you run it.

Why do my charts have different heights after I set one width?

With Lock aspect ratio enabled, each chart retains its existing proportions. Charts with different original proportions can therefore have the same width but different heights.

Can I run the VBA macro in Excel for the web?

No. Open the workbook in desktop Excel to add and run the macro through the Developer tab.