Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am attempting to use the Msgbox function with the Ok/Cancel buttons. the
code I have written thus far is below: Msgbox("Message",1) If ans = vbOk then call [subroutine] If ans = vbCancel the exit sub end if end sub The subroutine does not work when the "Ok" button is used. I have tried other variations on this to no avail. Could anyone please assist? -- Thanks, Pete |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try one of these
Sub Macro1() If MsgBox("Message", 1) < vbOK Then Exit Sub Call subroutine End Sub Sub Macro2() Dim ans As Variant ans = MsgBox("Message", 1) If ans = vbOK Then Call [subroutine] Else Exit Sub End If End Sub -- Jacob "Pete" wrote: I am attempting to use the Msgbox function with the Ok/Cancel buttons. the code I have written thus far is below: Msgbox("Message",1) If ans = vbOk then call [subroutine] If ans = vbCancel the exit sub end if end sub The subroutine does not work when the "Ok" button is used. I have tried other variations on this to no avail. Could anyone please assist? -- Thanks, Pete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Answers to questions posing more questions in a workbook | Excel Worksheet Functions | |||
View Questions and Answer to questions I created | Excel Discussion (Misc queries) | |||
msgbox | Excel Discussion (Misc queries) | |||
MsgBox | Excel Discussion (Misc queries) | |||
msgbox | Excel Discussion (Misc queries) |