Home>Blogs>VBA>Make same size of selected shapes/Charts/Pictures using single click
Make Same Size of Shapes
VBA

Make same size of selected shapes/Charts/Pictures using single click

In this article, we have created a macro to make the same size of the selected shapes, charts, or pictures. It will change the size accordingly to first object in the selection.

It is quite useful while create the Excel report or dashboard.

Click here to download the PK’s Utility Tool free of cost

Make same size of selected shapes/Charts/Pictures using single click

Make Same Size of Shapes

Make Same Size of Shapes

Option Explicit



Sub Make_Same_Size()



If TypeName(Selection) <> "DrawingObjects" Then

MsgBox "Plase select the charts, shapes or pictures to make the same size", vbCritical

Exit Sub

End If



Dim sh As Worksheet

Set sh = ActiveSheet

Dim sp As Object



Dim h, w As Single



For Each sp In Selection

h = sp.Height

w = sp.Width

Exit For

Next



For Each sp In Selection

sp.Height = h

sp.Width = w

Next



End Sub

Visit our YouTube channel to learn step-by-step video tutorials

Youtube.com/@PKAnExcelExpert

Watch the step-by-step video tutorial:

Click here to download the practice file

Looking for ready-made Excel VBA Tools?
Browse finished, fully working templates you can use with your own data straight away.
PK
Meet PK, the founder of PK-AnExcelExpert.com! With over 15 years of experience in Data Visualization, Excel Automation, and dashboard creation. PK is a Microsoft Certified Professional who has a passion for all things in Excel. PK loves to explore new and innovative ways to use Excel and is always eager to share his knowledge with others. With an eye for detail and a commitment to excellence, PK has become a go-to expert in the world of Excel. Whether you're looking to create stunning visualizations or streamline your workflow with automation, PK has the skills and expertise to help you succeed. Join the many satisfied clients who have benefited from PK's services and see how he can take your Excel skills to the next level!
https://www.pk-anexcelexpert.com