Combobox VBA in PowerPoint

samc2696

New Member
Joined
Jul 16, 2018
Messages
42
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
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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:
Upvote 0
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:
Upvote 0

Forum statistics

Threads
1,223,631
Messages
6,173,465
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top