PowerPoint serves as a canvas for many to convey ideas visually. But fiddling with shape adjustments manually? A drain on your time and creativity. Enter the Rounded Corner Macro—a single piece of VBA code that automates the process.
What Does This Macro Do?
This macro automates the conversion of conventional rectangular shapes in your presentation into rounded rectangles. It also allows you to specify the “roundness” by asking for a radius factor. I’ve modified the original code I found on Stack Overflow to include a dialogue box, so you don’t have to edit the code every time you need to round a corner.
Why Should You Care?
- Uniform Design: Ensures a consistent look throughout your slides, reinforcing a professional image.
- Efficiency: Reclaims your time, redirecting it towards crafting the content of your presentation.
Quick Start Guide
You can start with my file open while working on your project.
- Open VBA Editor in PowerPoint: Usually accessible via
Developer > Visual Basic
. - Copy & Paste the Code: Take the VBA code below and paste it into the editor.
- Run the Macro: All shapes in your active presentation will now be rounded rectangles with a uniform radius that you specify.
Here’s the VBA code for you to copy:
Sub RoundedCornerWithDialog() Dim oShape As shape Dim RadiusFactor As Single 'Display input box to get the radius factor RadiusFactor = InputBox("Enter the radius factor (e.g. 50)", "Rounded Corner Macro") 'Check if user has entered a valid number If Not IsNumeric(RadiusFactor) Then MsgBox "Invalid input. Please enter a numeric value." Exit Sub End If 'Loop through each selected shape in the active PowerPoint window For Each oShape In ActiveWindow.Selection.ShapeRange With oShape .AutoShapeType = msoShapeRoundedRectangle .Adjustments(1) = RadiusFactor / (.Height + .Width) .TextFrame.WordWrap = msoFalse .TextEffect.Alignment = msoTextEffectAlignmentCentered End With Next End Sub
Understanding the Code: A Step-By-Step Guide
- Prompt for Radius Factor: The macro starts by asking for a radius factor that will dictate the roundness.
- Validate User Input: If you enter a non-numeric value, an error message pops up, and the macro aborts.
- Shape Modification: Each shape in your active presentation is converted to a rounded rectangle, its radius adjusted per your input, and text settings configured.
Benefits and Use Cases
- Unified Design: Makes all shapes rounded for a cohesive look.
- Visual Elevation: Transforms boring rectangles into stylish rounded rectangles.
- Efficiency: Eliminates manual work, freeing up time for more creative tasks.
Below you’ll find a demo of the script in action.
I hope you find this macro as useful as I did. It’s a simple yet potent tool for elevating your PowerPoint presentations. Do you have other PowerPoint tips or hacks? Feel free to share; I’m all ears for improving presentation skills.