Others

How to Create PowerPoint Slides for Every Date of the Year with VBA

Huma Ashraf ChHuma Ashraf Ch Nov 2, 2026 868 views

Question details

The user needs to automatically generate a presentation containing one slide for every day of a specific year, including handling February 29th for leap years, using a VBA macro and a custom layout.

How to Create PowerPoint Slides for Every Date of the Year with VBA
Product
Presentation
Device & OS
not provided
Scenario
Creating a daily planner, calendar, or daily tracking presentation that requires exactly 365 or 366 sequentially dated slides.
Observed behavior
A complete presentation is successfully generated with daily dated slides based on a consistent custom layout, accurately reflecting leap years when applicable.
Before you start

Ensure that you have enabled the Developer tab in your presentation software to access the VBA editor, and remember to save your file as a Macro-Enabled Presentation (.pptm) to keep your script intact.

Solution 1Recommended

Use a VBA Macro to Generate Daily Dated Slides

Set up a custom slide layout with a date placeholder and execute a VBA script to automatically loop through all days of the year, creating a new slide for each date.

This method leverages the Visual Basic for Applications (VBA) feature to automate the repetitive task of creating 365 or 366 slides. By defining a start date in the code, the script accurately calculates the progression of days, identifies leap years, and updates the first placeholder on each new slide with the corresponding date text.

1
Create a Custom Layout

Go to the 'View' tab and open the 'Slide Master'. Create a new custom layout, insert a text placeholder, and format it with your desired fonts. Ensure this is the first placeholder added to the layout. Close the Slide Master and apply this layout to your starting slide.

2
Open the VBA Editor

Press 'Alt + F11' on your keyboard to launch the VBA editor. You can also access this by clicking 'Visual Basic' under the Developer tab.

3
Insert a New Module

In the top menu of the VBA editor, click 'Insert' and select 'Module'. This will create a blank text area where you can input your macro code.

4
Paste the Macro Code

Copy your daily slide generation VBA script and paste it into the module window. Locate the variable for the starting year or date within the code and update it to your target year.

5
Run the Macro

Close the VBA editor window. Back in your presentation, press 'Alt + F8' to open the Macro dialog box, select the macro you just pasted, and click 'Run'. The slides will instantly generate.

Use a VBA Macro to Generate Daily Dated Slides
Placeholder Targeting: If you decide to add more placeholders to your master slide later, make sure the date placeholder remains the primary one. VBA macros typically populate dates into the first placeholder index (Shape 1).
WPS Presentation Automation

Create Macro-Enabled Presentations with WPS Office

WPS Presentation fully supports VBA macros, making it incredibly simple to automate heavy tasks like generating a slide for every single day of the year. It provides a robust, user-friendly environment for both casual users and advanced macro developers.

  1. 1. Enable Developer Tools: Open WPS Presentation, go to the Options menu, and ensure the Developer Tools are enabled so you can access the VBA editor interface.
  2. 2. Set Up Your Slide Master: Navigate to the View tab, select Slide Master, and design your daily slide layout by inserting a primary text placeholder for the date.
  3. 3. Execute the Macro: Press Alt+F11 to open the WPS Macro Editor, insert a new module with your date-generating code, and run it to instantly build your 365-day presentation.
Full support for VBA macros and Developer toolsHighly compatible with Microsoft PowerPoint (.pptm) filesRich customizable slide master and placeholder settingsLightweight, fast, and free to download
microsoft office alternative - wps office

Frequently Asked Questions

Do I need to run the macro every time I open the presentation?

No, you only need to run the macro once to generate the slides. Once the slides are created, simply save your presentation. The dates and slides will remain statically saved.

Does the VBA code automatically handle leap years?

Yes, standard date-generation VBA scripts utilize built-in date functions (like DateAdd) which inherently understand calendar rules. It will accurately include February 29th only when the target year is a leap year.

How do I update the presentation for the following year?

To create slides for a new year, you will need to open the VBA editor (Alt+F11), locate the start date or year variable in the script, update it to the following year (e.g., change 2024 to 2025), and run the macro again in a fresh presentation.

What happens if I add more placeholders to the master slide?

If you add more placeholders, the VBA script might populate the date into the wrong text box if it is programmed to target the first shape index. Always ensure the designated date placeholder is created first on your custom layout.