#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default MsgBox

Here are two ways:

Sub test1()
Dim i As Long

i = MsgBox("Click something", vbYesNoCancel, "Click Me")
If i = vbYes Then
Debug.Print "Yes"
ElseIf i = vbNo Then
Debug.Print "No"
Else
Debug.Print "Cancel"
End If
End Sub

Sub test2()
Select Case MsgBox("Click something", vbYesNoCancel, "Click Me")
Case vbYes: Debug.Print "Yes"
Case vbNo: Debug.Print "No"
Case vbCancel: Debug.Print "Cancel"
End Select
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"dcstech" wrote in message
...
How do you get the return status from a message box............i.e. What

button was pushed?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
msgbox peyman Excel Discussion (Misc queries) 2 September 29th 07 08:21 PM
msgbox flow23 Excel Discussion (Misc queries) 0 January 10th 06 03:25 PM
MsgBox Randal W. Hozeski Excel Programming 1 January 2nd 04 08:54 PM
Msgbox help JonoB Excel Programming 2 October 27th 03 03:06 PM
Msgbox Bernd[_2_] Excel Programming 0 October 24th 03 10:20 AM


All times are GMT +1. The time now is 03:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"