Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
[font=courier new]I've got a msgbox that asks a question, that questio
being "Do you wish to continue?" and two VB button, "yes" & "No". I they click "yes" I want the macro to continue, if on the other han they click "no" I want the .xls to close without saving. Can this be done and if so how?[/FONT -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like
Dim Result As Long Result = MsgBox("Do you want to continue", vbYesNo) If Result = vbNo Then ThisWorkbook.Close savechanges:=False Exit Sub End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Fraggs " wrote in message ... I've got a msgbox that asks a question, that question being "Do you wish to continue?" and two VB button, "yes" & "No". If they click "yes" I want the macro to continue, if on the other hand they click "no" I want the .xls to close without saving. Can this be done and if so how? --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If MsgBox("Do you want to continue", vbYesNo) = vbNo Then ActiveWorkbook.Close SaveChanges:=False Exit Sub End If -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Fraggs " wrote in message ... I've got a msgbox that asks a question, that question being "Do you wish to continue?" and two VB button, "yes" & "No". If they click "yes" I want the macro to continue, if on the other hand they click "no" I want the .xls to close without saving. Can this be done and if so how? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Exit Sub | Excel Discussion (Misc queries) | |||
Run when exit | Excel Worksheet Functions | |||
If a called sub exit, how to the caller exit right away? | Excel Programming | |||
Exit Sub? | Excel Programming | |||
If no FIND value is found, then a Msgbox to say so and exit sub | Excel Programming |