Dim ans As Variant
ans = MsgBox("Click OK or Cancel", vbOKCancel)
If ans = vbOK Then
MsgBox "You selected OK"
Else
MsgBox "You selected Cancel"
End If
Private Sub CommandButton1_Click()
Dim result As String
result = Application.Dialogs(xlDialogWorkbookUnhide).Show
MsgBox result
End Sub