Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I do this message box?
At the beginning of the my macro I would like a message/prompt box t appear with a question on it. if the user ticks/presses yes then the marco continues, if the use presses/clicks no then the macro stops. Thanks in advanc -- CarolineHedge ----------------------------------------------------------------------- CarolineHedges's Profile: http://www.excelforum.com/member.php...fo&userid=3570 View this thread: http://www.excelforum.com/showthread.php?threadid=56832 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I do this message box?
Public Sub MboxTest()
Dim mbRes As VbMsgBoxResult mbRes = MsgBox("Do you want to continue?", vbYesNo, "MsgBox Test") If mbRes = vbNo Then Exit Sub Else 'your code here End If End Sub "CarolineHedges" <CarolineHedges.2c0rrr_1154701507.9944@excelforu m-nospam.com schreef in bericht news:CarolineHedges.2c0rrr_1154701507.9944@excelfo rum-nospam.com... At the beginning of the my macro I would like a message/prompt box to appear with a question on it. if the user ticks/presses yes then the marco continues, if the user presses/clicks no then the macro stops. Thanks in advance -- CarolineHedges ------------------------------------------------------------------------ CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705 View this thread: http://www.excelforum.com/showthread...hreadid=568326 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I do this message box?
Sub test()
Dim res As Long res = MsgBox("Do you want to continue", _ vbYesNo Or vbQuestion, "My Macro") If Not (res = vbYes) Then MsgBox "Bye" Exit Sub End If MsgBox "Let's go..." End Sub Regards, Peter T "CarolineHedges" <CarolineHedges.2c0rrr_1154701507.9944@excelforu m-nospam.com wrote in message news:CarolineHedges.2c0rrr_1154701507.9944@excelfo rum-nospam.com... At the beginning of the my macro I would like a message/prompt box to appear with a question on it. if the user ticks/presses yes then the marco continues, if the user presses/clicks no then the macro stops. Thanks in advance -- CarolineHedges ------------------------------------------------------------------------ CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705 View this thread: http://www.excelforum.com/showthread...hreadid=568326 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I do this message box?
Thank you! Carolin -- CarolineHedge ----------------------------------------------------------------------- CarolineHedges's Profile: http://www.excelforum.com/member.php...fo&userid=3570 View this thread: http://www.excelforum.com/showthread.php?threadid=56832 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I do this message box?
Here's one way.
Msg = "Your question?" ' Define message. Style = vbYesNo ' Define buttons. Title = "Title of message box" ' Define title. If MsgBox(Msg, Style, Title) = vbNo Then End MsgBox ("You selected Yes. Your code will continue") "CarolineHedges" <CarolineHedges.2c0rrr_1154701507.9944@excelforu m-nospam.com wrote in message news:CarolineHedges.2c0rrr_1154701507.9944@excelfo rum-nospam.com... At the beginning of the my macro I would like a message/prompt box to appear with a question on it. if the user ticks/presses yes then the marco continues, if the user presses/clicks no then the macro stops. Thanks in advance -- CarolineHedges ------------------------------------------------------------------------ CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705 View this thread: http://www.excelforum.com/showthread...hreadid=568326 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I do this message box?
Careful using End in code. End is dangerous as it clears all global
variables/objects. You would be better off with Exit Sub... -- HTH... Jim Thomlinson "PCLIVE" wrote: Here's one way. Msg = "Your question?" ' Define message. Style = vbYesNo ' Define buttons. Title = "Title of message box" ' Define title. If MsgBox(Msg, Style, Title) = vbNo Then End MsgBox ("You selected Yes. Your code will continue") "CarolineHedges" <CarolineHedges.2c0rrr_1154701507.9944@excelforu m-nospam.com wrote in message news:CarolineHedges.2c0rrr_1154701507.9944@excelfo rum-nospam.com... At the beginning of the my macro I would like a message/prompt box to appear with a question on it. if the user ticks/presses yes then the marco continues, if the user presses/clicks no then the macro stops. Thanks in advance -- CarolineHedges ------------------------------------------------------------------------ CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705 View this thread: http://www.excelforum.com/showthread...hreadid=568326 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
replace VBA run-time error message with custom message | Excel Programming | |||
Replace Excel Message w/Custom Message | Excel Programming | |||
Intercept/replace standard 'cell protected' message with my own message? | Excel Programming | |||
Opening an attachment of a message that has a message as attachmen | Excel Programming | |||
Displaying a message in a message box without requiring user to click anything to proceed | Excel Programming |