Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

PowerPoint Macro to distribute shapes vertically

Posted on 2012-09-14
2
Medium Priority
?
1,770 Views
Last Modified: 2012-09-17
I know essentially nothing about macros but really need one here.

I am working on several hundred PowerPoint presentations, each containing several hundred slides. On each slide is one text box and one table. In short: the table overlaps the text box and I want to distribute them vertically on the slide.

The problem is that the PowerPoints are created by exporting data from an online application directly into PowerPoint. The export aligns everything horizontally (centered) but the text boxes and tables overlap. There is no way to change the features or settings of the export.

As my only other option is to manually drag each table on each slide, or select all and distribute vertically, I would MUCH rather have a macro to do this.

I have explored quite a lot of samples of VBA code and can even get one that works, provided I have manually selected all of the shapes on the slide, which sort of defeats the purpose.

I know I need something like the following sequence (this is just what I want to happen, not an attempt at code):

For each slide in the presentation
Select all shapes (or select shape range?)
Distribute Vertically

That's it! That's all I need! But I cannot make it happen. To help matters, I'm using Office 2011 on a Mac and there is no "record macro" feature. It simply isn't included.

Help? Anyone? Please?
0
Comment
Question by:e_m_h
2 Comments
 
LVL 23

Accepted Solution

by:
JSRWilson earned 2000 total points
ID: 38401483
Don't use a Mac but this would work on a PC

Sub DVert()
Dim osld As Slide
For Each osld In ActivePresentation.Slides
With osld.Shapes.Range
.Distribute msoDistributeVertically, msoTrue
End With
Next osld
End Sub
0
 

Author Closing Comment

by:e_m_h
ID: 38406077
It's perfect. Thank you!
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of things can happen during a presentation, worst of which is “death by PowerPoint.” Here are a few mistakes to avoid to make your slides clean.
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
The viewer will learn how to edit animations within the presentation, incorporate sound, and set everything up with timing.
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question