PC Review


Reply
Thread Tools Rate Thread

How to cancel a macro once started?

 
 
John
Guest
Posts: n/a
 
      29th Oct 2008
I know nothing about VBA except the recorder and able to modify a bit.
I have a macro to erase a form that is activated with a button. I would like
to be able to
have a message to confirm the deletion (Msgbox ) but have the choice to say
no and stop the macro from erasing.
I would appreciate any help please
Thanking you in advance
John

 
Reply With Quote
 
 
 
 
Daniel.C
Guest
Posts: n/a
 
      29th Oct 2008
Try :
answ = MsgBox("Are you really sure ?", vbYesNo)
If answ = vbNo Then Exit Sub
' delete
Regards.
Daniel

> I know nothing about VBA except the recorder and able to modify a bit.
> I have a macro to erase a form that is activated with a button. I would like
> to be able to
> have a message to confirm the deletion (Msgbox ) but have the choice to say
> no and stop the macro from erasing.
> I would appreciate any help please
> Thanking you in advance
> John



 
Reply With Quote
 
John
Guest
Posts: n/a
 
      29th Oct 2008
Thank you Daniel
It works great
Have a nice day
John
"Daniel.C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Try :
> answ = MsgBox("Are you really sure ?", vbYesNo)
> If answ = vbNo Then Exit Sub
> ' delete
> Regards.
> Daniel
>
>> I know nothing about VBA except the recorder and able to modify a bit.
>> I have a macro to erase a form that is activated with a button. I would
>> like to be able to
>> have a message to confirm the deletion (Msgbox ) but have the choice to
>> say no and stop the macro from erasing.
>> I would appreciate any help please
>> Thanking you in advance
>> John

>
>


 
Reply With Quote
 
John
Guest
Posts: n/a
 
      29th Oct 2008
Thanks Charlotte
Works great
Regards
John
"Charlotte E." <@> wrote in message
news:(E-Mail Removed)...
>A one liner:
>
> If MsgBox("Do you want to delete?", vbYesNo + vbQuestion, "Confirm
> Delete") = vbNo Then Exit Sub
>
>
> CE
>
>
>
> John wrote:
>> I know nothing about VBA except the recorder and able to modify a bit.
>> I have a macro to erase a form that is activated with a button. I
>> would like to be able to
>> have a message to confirm the deletion (Msgbox ) but have the choice
>> to say no and stop the macro from erasing.
>> I would appreciate any help please
>> Thanking you in advance
>> John

>
>


 
Reply With Quote
 
Maperalia
Guest
Posts: n/a
 
      15th Jan 2009
Daniel;
Thanks very much for the code. It is working wonderfully!!!!!!

Kind regards.
Maperalia

"Daniel.C" wrote:

> Try :
> answ = MsgBox("Are you really sure ?", vbYesNo)
> If answ = vbNo Then Exit Sub
> ' delete
> Regards.
> Daniel
>
> > I know nothing about VBA except the recorder and able to modify a bit.
> > I have a macro to erase a form that is activated with a button. I would like
> > to be able to
> > have a message to confirm the deletion (Msgbox ) but have the choice to say
> > no and stop the macro from erasing.
> > I would appreciate any help please
> > Thanking you in advance
> > John

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I cancel transmit once it has started karleiben Microsoft Outlook Discussion 1 4th Aug 2009 08:11 AM
Cancel message in outbox when 'outlook already started transmit' Suricatta Microsoft Outlook Discussion 1 14th Aug 2008 03:27 PM
Cancel export to excel after it has started =?Utf-8?B?TnVnaW1hYw==?= Microsoft Access External Data 2 24th Apr 2007 09:34 PM
Cancel Macro is user selects 'cancel' at save menu =?Utf-8?B?TWFyaw==?= Microsoft Excel Programming 1 6th Apr 2005 05:45 PM
Started WinXP Pro- how do I cancel? =?Utf-8?B?SGVuc3Rlcg==?= Windows XP General 3 26th Apr 2004 07:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:43 AM.