Consulting

Results 1 to 8 of 8

Thread: Filter Slides for Sales Presentations

  1. #1
    VBAX Newbie
    Joined
    Feb 2008
    Posts
    4
    Location

    Filter Slides for Sales Presentations

    Let me begin with my ultimate question and then provide some background:
    How do you apply a tag to multiple slides?

    and now some background:

    I work at a computer engineering firm in the marketing department. We use powerpoint to create sales presentations for various departments in the company. Specifically in my sector we use 4 specific types of Sales Presentations (Divisional, Application, Product Line, and New Product).

    Basically, my boss wants to compile a master slide show that can filter slides based on those 4 criteria.

    activepresentation.Slides(2).Tags.Add "Marketing", "Divisional"
    activepresentation.Slides(3).Tags.Add "Marketing", "Application"
    activepresentation.Slides(4).Tags.Add "Marketing", "Product Line"
    activepresentation.Slides(5).Tags.Add "Marketing", "New Product"
    My solution was to use tags to designate each slide into one of the 4 categories. Then, I hid all the slides. A UserForm then pops up which allows you to check which slide set you want to see based on their tags.

    Private Sub CheckBox1_Click()
    If CheckBox1.Value = True Then
        For Each s In activepresentation.Slides
            If s.Tags("marketing") = "Divisional" Then
                 s.SlideShowTransition.Hidden = msoFalse
            End If
        Next
    End If
    If CheckBox1.Value = False Then
        For Each s In activepresentation.Slides
            If s.Tags("marketing") = "Divisional" Then
                s.SlideShowTransition.Hidden = msoTrue
            End If
        Next
    End If
    End Sub
    
    Private Sub CheckBox2_Click()
    If CheckBox2.Value = True Then
        For Each s In activepresentation.Slides
            If s.Tags("marketing") = "Application" Then
                s.SlideShowTransition.Hidden = msoFalse
            End If
        Next
    End If
    If CheckBox2.Value = False Then
        For Each s In activepresentation.Slides
            If s.Tags("marketing") = "Application" Then
                s.SlideShowTransition.Hidden = msoTrue
            End If
        Next
    End If
    End Sub
    
    Private Sub CheckBox3_Click()
    If CheckBox3.Value = True Then
        For Each s In activepresentation.Slides
            If s.Tags("marketing") = "Product Line" Then
                s.SlideShowTransition.Hidden = msoFalse
            End If
        Next
    End If
    If CheckBox3.Value = False Then
        For Each s In activepresentation.Slides
            If s.Tags("marketing") = "Product Line" Then
                s.SlideShowTransition.Hidden = msoTrue
            End If
        Next
    End If
    End Sub
    
    Private Sub CheckBox4_Click()
    If CheckBox4.Value = True Then
        For Each s In activepresentation.Slides
            If s.Tags("marketing") = "New Product" Then
                s.SlideShowTransition.Hidden = msoFalse
            End If
        Next
    End If
    If CheckBox4.Value = False Then
        For Each s In activepresentation.Slides
            If s.Tags("marketing") = "New Product" Then
                s.SlideShowTransition.Hidden = msoTrue
            End If
        Next
    End If
    End Sub
    
    Private Sub CommandButton1_Click()
    With activepresentation.SlideShowSettings.Run.View
    End With
    End Sub
    This solution works well for a few slides but I will soon be working with over 100 slides and will need to tag multiple slides with the same tags. How can I do this efficiently?
    Last edited by Aussiebear; 04-28-2023 at 09:16 PM. Reason: Adjusted the code tags

  2. #2
    Is there a reason to have the information organized in this manner? In every presentation, you are going to have 3 other "hidden" presentations. Leads to rather large files.

    Seems more logical to break them down into the 4 specific presentations and use those as the base to add / delete slides.

    If you cannot dictate the structure and you have to continue as you are... You can put several of your 'criteria' in the tag. ie: Application/New Product. Then use INSTR to determine if your 'criteria' is in your tag.
    ___________________________________
    g-
    gwkenny@Fin-ITSolutions.com
    ___________________________________

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Ctrl click to select multiple slides and
    Sub addtags()
    Dim osld As Slide
    For Each osld In ActiveWindow.Selection.SlideRange
        osld.Tags.Add "name", "Value"
    Next
    End Sub
    Last edited by Aussiebear; 04-28-2023 at 09:17 PM. Reason: Adjusted the code tags
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  4. #4
    VBAX Newbie
    Joined
    Feb 2008
    Posts
    4
    Location

    Thanks

    I agree that it is quite clumsy but it's what he wants. Thanks for the help. The code worked great and now I have a fully functional, filtered (albeit massive!) presentation.

  5. #5
    VBAX Newbie
    Joined
    Feb 2008
    Posts
    4
    Location

    Slide Show view

    Well, the code works great but now I can't view those slides when I run the slideshow. Any idea why?

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Adding tags can't cause slides not to show so you will need to look elsewhere for the solution

    Could the slides be marked hidden?
    Could they have an auto transition?
    In set up show is "Show All" ticked?
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  7. #7
    VBAX Newbie
    Joined
    Feb 2008
    Posts
    4
    Location
    Doh!
    Somehow, it was only setup to show the 1st 5 slides. When I told it to show all slides it worked. I have no idea when I told it to only show the 1st 5 slides but whatever, it all works now! thanks again for all of your help!

  8. #8
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    That's good! Glad to help

    John
    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
  •