Message Boxes

  • Thread starter Thread starter Shane
  • Start date Start date
S

Shane

Hi there
I am having a play around with message boxes and need a little help.
I know how to show a message box that displays YES NO CANCEL. what I
don't know how to do is get the YES NO working.
I would like YES to save the workbook and close.
No to unhide a sheet.

Is this possible to do without having to use a userform?

Thank you

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Business Software Galore!
Free Excel Forum http://www.ozgrid.com/forum ***
 
Hi

Sub test()
Select Case MsgBox("Pick one", vbYesNoCancel, "Yo!")
Case vbYes
MsgBox "You said yes"
Case vbNo
MsgBox "You said no"
Case Else
MsgBox "You cancelled"
End Select
End Sub

Replace vbYesNoCancel with vbYesNo if you don't want a Cancel option.

HTH. Best wishes Harald
 
Back
Top