PDA

View Full Version : Running Macro across multiple pages (Powerpoint)



Marvin1993
04-23-2018, 07:19 AM
Hello all,

I have a attached a file with a macro that sorts shapes based on the date within the shape group (from newest to oldest).

The macro works perfectly on one page, but I am trying to get it to sort across multiple pages. For example, on the second slide, there are more shapes that are out of order. So I want page 1 and 2, etc. to sort together so in the end, shapes from page 2 would end up on page 1 (if they have a more recent date).

Can this be done with macros?

*I did not create this macro*

neilt17
04-28-2018, 02:22 AM
Perhaps you could post the code here?

John Wilson
04-29-2018, 04:28 AM
The code is in the file he attached.

isaro2002
07-16-2018, 08:18 AM
It is a bit dangerous that you put a code without supervision ....
May be you need to put in your macro:
...
Dim diapositiva As Slide
For Each diapositiva In ActivePresentation.Slides
diapositiva.Select
ActiveWindow.Selection.SlideRange.Shapes.SelectAll
...

this code goes through each of the slides you have in your presentation

John Wilson
07-16-2018, 09:23 AM
You hardly ever need to select things in powerPoint code. Looping through slides / shapes is no problem but the poster is trying to do a very complex sort which will be very difficult.

isaro2002
07-16-2018, 09:37 AM
and if you try to make the macro go through the slides selecting the shapes to copy> select copy and paste in a new slide> apply the macro that orders all the selected shapes ?? or maybe I do not understand it well ...

John Wilson
07-16-2018, 09:53 AM
I think you are misunderstanding the complexity of the sorting he needs.

You would need to load the shapes from two slides into an array, sort the array based on date in the text and then recreate the shapes on the slides from the array. Not impossible but more work that I am about to do right now. Feel free to have a go. I wrote the original code I think which you are welcome to work on.

isaro2002
07-16-2018, 10:06 AM
I'll try it and see my misunderstanding

John Wilson
07-23-2018, 06:36 AM
This should help but it's not a fully debugged solution