Combobox VBA in PowerPoint

samc2696

New Member
Joined
Jul 16, 2018
Messages
38
Hi all,
I know this is technically an Excel forum but wasn't too sure where else to post this.

Essentially I am trying to create a drop-down navigation tool Combobox for all the slides I have on my PowerPoint so users can jump around the presentation no matter which slide they are on. I have the code written out so that I have the navigation part working but the problem is that when the user navigates to a slide, the drop-down that is on that slide has the last value the user chose from the list on that slide only.

What I would really like is to have a default value something like "click here to navigate"

I can't seem to find a way to make that happen

Thanks
Sam
 

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,746
Office Version
  1. 365
Platform
  1. Windows
Try something like this

Code:
Private Sub ComboBox1_Change()

   [I] '[COLOR=#006400]the code to jump to other slide goes here[/COLOR][/I]
    
  [COLOR=#006400] [I] 'followed by ...[/I][/COLOR]
    Application.EnableEvents = False
        ComboBox1.Value = "click here to navigate"
    Application.EnableEvents = True
End Sub
 
Last edited:

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,746
Office Version
  1. 365
Platform
  1. Windows
I had forgotten that EnableEvents does not apply to PowerPoint :oops:

Tested with Office 365
- loads the combobox
- moves to selected slide
- set combobox text to default
Code:
Private Sub ComboBox1_Change()
    On Error Resume Next
    SlideShowWindows(1).View.GotoSlide ComboBox1
    ComboBox1.Value = "click here to navigate"
End Sub

Private Sub ComboBox1_GotFocus()
    Dim s As Long
    With ComboBox1
        .Clear
        For s = 1 To ActivePresentation.Slides.Count
            .AddItem s
        Next
    End With
End Sub
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,108,991
Messages
5,526,105
Members
409,685
Latest member
Bellybb

This Week's Hot Topics

Top