Resize All Charts using Macros (VBA) in Excel Office 365!!
Tags: resizeallchartsusing, vbamacros
Published: 2021-02-10 09:32:14

---
title: Resize All Charts using Macros (VBA) in Excel Office 365!!
published: true
date: 2021-02-03 11:41:17 UTC
tags: Resizeallchartsusing,VBAMacros
canonical_url: https://geekexcel.com/resize-all-charts-using-macros-vba-in-excel-office-365/
---

If you have a lot of [charts](https://geekexcel.com/excel-charts-types-in-office-365/) in one worksheet in Excel and you want to organize them, what will you do? You can achieve it with the help of Macros in Excel. [VBA](https://geekexcel.com/excel-office-365-vba-overview-definition-and-examples/) and Macros are really easy to understand and perform tasks. In this article, we are going to see how to **resize all charts using Macros (VBA) in Excel Office 365**. Let’s get into this article.

## Instructions to Resize All Charts using Macros:

Follow the below instructions to resize all charts in Excel.

- In the below screenshot, you can see **three charts** in one worksheet, and we are going to resize all of them.

![Example Charts](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_5VQaNpYp5F.png)<figcaption id="caption-attachment-21641">Example Charts</figcaption>

- On the **Developer Tab, select** the **Visual Basic** option under the **Code** section.

![Select Visual Basic option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Select-Visual-Basic-option-5.png)<figcaption id="caption-attachment-14839">Select the Visual Basic option</figcaption>

- Then you need to copy and paste the code given below.

VBA code to resize charts using Macros

‘Change the Width and Height values below

Sub ResizeCharts()

Dim counter As Integer

‘Loop through all of the charts

For counter = 1 To ActiveSheet.ChartObjects.Count

With ActiveSheet.ChartObjects(counter)

.Height = 200

.Width = 200

End With

Next counter

End Sub

- You need to **save the code** by selecting it. Then **close** the **window.**

![Save the code](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_PRjlAwsV5E.png)<figcaption id="caption-attachment-21642">Save the code</figcaption>

- You have to open the sheet containing the data. On the **Developer Tab, choose** the **Macros option** in the **Code** section.

![Choose the Macros option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Choose-the-Macros-option-2.png)<figcaption id="caption-attachment-14747">Choose the Macros option</figcaption>

- You need to make sure that your macro is selected and **click** the **Run** button.

![Click the Run button](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_OPVkMPnmLX.png)<figcaption id="caption-attachment-21643">Click the Run button</figcaption>

- At last, you will see all the **resized charts** in your worksheet, and you can organize them as you wish.
- Refer to the below image.

![Output](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_IX00zbcp23.png)<figcaption id="caption-attachment-21644">Output</figcaption>

## Summary:

In the above article, we have described the simple instructions to **resize all charts using Macros (VBA) in Excel Office 365**. Share your **suggestions/feedback** in the below comment section. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!

### Keep Reading:

- [Insert a Linked Image using Macros (VBA) in Excel Office 365!!](https://geekexcel.com/insert-a-linked-image-using-macros-vba-in-excel-office-365/)
- [How to Add Chart Title using Macros (VBA) in Excel Office 365?](https://geekexcel.com/how-to-add-chart-title-using-macros-vba-in-excel-office-365/)