Consulting

Results 1 to 3 of 3

Thread: Unhide slides by date

  1. #1

    Unhide slides by date

    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
    Last edited by Aussiebear; 11-28-2022 at 11:58 AM. Reason: Added code tags to supplied code

  2. #2
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,158
    Location
    I don't think there is any support for VBA on PowerPoint for IPad, same with Excel etc...
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved

    Excel 365, Version 2401, Build 17231.20084

  3. #3
    VBAX Regular
    Joined
    May 2018
    Location
    Sydney
    Posts
    57
    Location
    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.
    If you only ever do what you can , you'll only ever be what you are.

Posting Permissions

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