PDA

View Full Version : Unhide slides by date



Vaninja
11-28-2022, 05:11 AM
I am trying to make an advent calendar for my students. I have a main page with a makro. They can only access the slides on certain dates. But now I realize they can still use the space bar or keys to access all slides. My solution would be to hide all slides and make them visible one by one by their respective dates.
I got a vba off the internet but as I am super inexperienced it does not work. Please, anyone got a solution? Do I have to use a different modul? Or can I add it to the first modul? Is there an easier way? Also the kids are using iPads. Does that change anything?


This is what's not working:


Sub hideslide()
Dim x As Integer
Dim d1 As Date
Dim d2 As Date
x = 1
d1 = Date
d2 = "11/20/2012"
On Error GoTo errhandler
If d1 < d2 Then
ActivePresentation.Slides(x).SlideShowTransition.Hidden = msoTrue
Else
ActivePresentation.Slides(x).SlideShowTransition.Hidden = msoFalse
End If
errhandler:
End Sub

georgiboy
11-29-2022, 01:41 AM
I don't think there is any support for VBA on PowerPoint for IPad, same with Excel etc...

Grade4.2
12-09-2022, 07:43 AM
Try this:


Sub ShowSlidesOnSpecificDates()
Dim i As Integer
Dim d1 As Date
Dim d2 As Date
d1 = Date
For i = 1 To ActivePresentation.Slides.Count
d2 = "11/20/2012" ' Replace this with the date you want to show the slide
If d1 = d2 Then
ActivePresentation.Slides(i).SlideShowTransition.Hidden = msoFalse
Else
ActivePresentation.Slides(i).SlideShowTransition.Hidden = msoTrue
End If
Next i
End Sub


This code should show the slide on the specified date and hide all other slides. You can modify the code to use different dates for each slide if you want.