Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msgbox
How do i use VKokCancel in a message box
I can't get it to work? regards alvin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msgbox
One way:
Dim nResult As Long nResult = MsgBox(Prompt:="Erase your hard drive?", _ Buttons:=vbOKCancel) If nResult = vbCancel Then MsgBox "You cancelled..." Else MsgBox "Just kidding!" End If , Alvin Hansen wrote: How do i use VKokCancel in a message box I can't get it to work? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msgbox
Set a variable to the MsgBox results
ans = MsgBox(...) and test that for vbOK or vbCancel If ans = vbOK then ... ElseIf ans = vbCancel Then ... -- HTH RP (remove nothere from the email address if mailing direct) "Alvin Hansen" wrote in message ... How do i use VKokCancel in a message box I can't get it to work? regards alvin |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msgbox
Sub ABCD()
Dim ans As Long ans = MsgBox("Ok or Cancel?", vbOKCancel) If ans = vbOK Then MsgBox "You clicked OK" ElseIf ans = vbCancel Then MsgBox "You clicked cancel" End If End Sub -- Regards, Tom Ogilvy "Alvin Hansen" wrote in message ... How do i use VKokCancel in a message box I can't get it to work? regards alvin |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msgbox
Thank you all
So simpel............................................ . regards alvin "Tom Ogilvy" skrev: Sub ABCD() Dim ans As Long ans = MsgBox("Ok or Cancel?", vbOKCancel) If ans = vbOK Then MsgBox "You clicked OK" ElseIf ans = vbCancel Then MsgBox "You clicked cancel" End If End Sub -- Regards, Tom Ogilvy "Alvin Hansen" wrote in message ... How do i use VKokCancel in a message box I can't get it to work? regards alvin |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Msgbox
Funny AND helpful... Cheers
"JE McGimpsey" wrote: One way: Dim nResult As Long nResult = MsgBox(Prompt:="Erase your hard drive?", _ Buttons:=vbOKCancel) If nResult = vbCancel Then MsgBox "You cancelled..." Else MsgBox "Just kidding!" End If , Alvin Hansen wrote: How do i use VKokCancel in a message box I can't get it to work? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
msgbox | Excel Discussion (Misc queries) | |||
Msgbox | Excel Programming | |||
help with Msgbox | Excel Programming | |||
MsgBox Help! | Excel Programming | |||
msgbox | Excel Programming |