How to Reverse Animation Order in PowerPoint Using VBA
Question details
The user needs a VBA macro to automatically reverse the execution order of animations across multiple slides in a presentation.

- Product
- Microsoft PowerPoint
- Device & OS
- not provided
- Scenario
- Reversing the display order of bilingual flashcards (e.g., animating Spanish first, then English) in a presentation to save time compared to manual editing.
- Observed behavior
- The current animation sequence displays one language before another, and manually reversing these sequences across numerous slides is tedious and inefficient.
Before modifying your presentation with VBA, ensure you have enabled the Developer tab in your ribbon and backed up your original presentation file, as macro changes cannot be undone using the standard undo command.
Utilize the Object Model to Reorder Animations with VBA
Use a VBA macro to iterate through the slide's animation effects and rearrange their execution order within the timeline.
Programming animations in presentations is more complex than standard Excel VBA tasks. Animations are tied to Shape objects (such as TextBoxes containing TextFrames) and are controlled via the slide's TimeLine object.
To reverse the order, you must reference the MainSequence collection of the TimeLine and manipulate the index of the Effect objects.
Press Alt + F11 to launch the Visual Basic for Applications editor. Click on 'Insert' in the top menu and select 'Module' to create a new script area.
Start your subroutine and define variables for the slide (Slide), shape (Shape), sequence (Sequence), and effect (Effect) objects to interact with the presentation Object Model.
Write a 'For Each' loop to iterate through all slides in the ActivePresentation. Inside the loop, access the animation sequence using 'Set seq = sld.TimeLine.MainSequence'.
Identify the specific effects applied to your flashcards (e.g., 'TextBox 1' and 'TextBox 2'). Use the 'Effect.MoveTo' method to change the index position of the second animation, moving it above the first one.
Press F5 to run the macro. Return to your presentation and preview the slide to ensure the animation sequence now plays in reverse order.

Reorder Animations Manually Using the Animation Pane
If you are unfamiliar with writing VBA code or the presentation is short, manually dragging the animations in the Animation Pane is a safer, no-code alternative.
Manage Macros and Animations Easily in WPS Presentation
WPS Office offers a powerful, built-in VBA Editor that allows you to automate repetitive tasks like reversing animation sequences. It is highly compatible with standard presentation object models, making it easy to run your custom VBA scripts.
- 1. Open your Presentation: Launch WPS Presentation and open the file containing your flashcards.
- 2. Access the Developer Tools: Navigate to the Tools tab on the ribbon and click on Developer to access the macro environment.
- 3. Launch the VBA Editor: Click on the VBA Editor button to open the coding workspace.
- 4. Insert the Script: Paste your animation reordering script into a new module.
- 5. Execute the Macro: Press F5 to run the script and instantly reverse your flashcard animations across the document.

Frequently Asked Questions
Why is my VBA macro returning an object reference error when reordering animations?
This usually happens if the macro references a shape or text box name that does not exist on the active slide. Ensure you are targeting the correct Shape.Name (e.g., 'TextBox 1') and that the slide actually contains the TimeLine.MainSequence effect you are trying to manipulate.
How do I find the specific names of the shapes I want to animate using VBA?
You can find shape names by opening the Selection Pane (Home > Select > Selection Pane). This will display a list of all objects on the current slide, allowing you to identify or rename the specific shapes (like your English and Spanish flashcards) for accurate targeting in your macro.
Are VBA macros that manipulate presentation animations compatible with WPS Office?
Yes, WPS Office supports standard VBA macros. You can open your macro-enabled presentation (.pptm) in WPS Presentation and run most automation scripts, including those interacting with the standard presentation object model.




