Originally Posted by
Cosmo
Either:
[vba]Private Sub CommandButton1_Click()
Dim Response As Integer
' Displays a message box with the yes and no options.
Response = MsgBox(prompt:="Are you sure you want to continue with your choice? You can't go back after your choice.", Buttons:=vbYesNo)
' If statement to check if the yes button was selected.
If Response = vbYes Then
MsgBox "Proceed to build your laptop."
ActivePresentation.SlideShowWindow.View.Next
Else
' The no button was selected.
MsgBox "Please pick the other option"
End If
End Sub
[/vba] or:
[vba]Private Sub CommandButton1_Click()
Msgbox_Yes_No
End Sub
Sub Msgbox_Yes_No()
Dim Response As Integer
' Displays a message box with the yes and no options.
Response = MsgBox(prompt:="Are you sure you want to continue with your choice? You can't go back after your choice.", Buttons:=vbYesNo)
' If statement to check if the yes button was selected.
If Response = vbYes Then
MsgBox "Proceed to build your laptop."
ActivePresentation.SlideShowWindow.View.Next
Else
' The no button was selected.
MsgBox "Please pick the other option"
End If
End Sub
[/vba] if you have multiple buttons you want to run the same Msgbox_Yes_No code.