Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi! I would like to have a point in my code that displays a message box that asks the user if they wish to continue or exit the macro. A simple "Yes" and "No" button would be ok. This may be a point in the main macro or a point in one of the subroutines. 1. What would the code look like for stopping the entire macro. 2. What would the code look like to stop the subroutine only. Thanks for any help or advice!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=540310 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Brian,
The following code will exit the current procedure if the user clicks Yes. Dim Res As VbMsgBoxResult Res = MsgBox("Do you want to continue?", vbYesNo) If Res = vbNo Then Exit Sub End If The following code will completely terminate VBA if the user clicks Yes. Note that all public (Global) variables will be reset to their default values. Dim Res As VbMsgBoxResult Res = MsgBox("Do you want to continue?", vbYesNo) If Res = vbNo Then End End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Brian Matlack" wrote in message news:Brian.Matlack.27jpup_1147187410.7878@excelfor um-nospam.com... Hi! I would like to have a point in my code that displays a message box that asks the user if they wish to continue or exit the macro. A simple "Yes" and "No" button would be ok. This may be a point in the main macro or a point in one of the subroutines. 1. What would the code look like for stopping the entire macro. 2. What would the code look like to stop the subroutine only. Thanks for any help or advice!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=540310 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Chip!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=540310 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data point on line is not over the point/tick in X axis... | Charts and Charting in Excel | |||
Increase size of a Forms Check Box (click on to enter check mark) | Excel Discussion (Misc queries) | |||
X Y Scatter With Point name on each point ? | Charts and Charting in Excel | |||
Check Point in VBA | Excel Programming | |||
I need more general XY point to point plotting than XY scatter in | Charts and Charting in Excel |