# Combobox VBA in PowerPoint



## samc2696 (Feb 16, 2019)

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


----------



## Yongle (Feb 17, 2019)

Try something like this


```
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
```


----------



## Yongle (Feb 18, 2019)

I had forgotten that EnableEvents does not apply to PowerPoint 

Tested with Office 365
- loads the combobox
- moves to selected slide
- set combobox text to default

```
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
```


----------

