Consulting

Results 1 to 9 of 9

Thread: Running Macro across multiple pages (Powerpoint)

  1. #1

    Running Macro across multiple pages (Powerpoint)

    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*
    Attached Files Attached Files

  2. #2
    VBAX Regular
    Joined
    Mar 2017
    Posts
    23
    Location
    Perhaps you could post the code here?

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    The code is in the file he attached.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  4. #4
    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

  5. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    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.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  6. #6
    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 ...

  7. #7
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    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.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  8. #8
    I'll try it and see my misunderstanding

  9. #9
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    This should help but it's not a fully debugged solution
    Attached Files Attached Files
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •