LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default Msg Box in IF statement?

Thanks soo much! Again!

"Toppers" wrote:

just code the vbNO response and the macro will continue on the next statement

resp = MsgBox("Do you want to run the macro?", vbYesNo, Confirm)
If resp = vbNo Then
MsgBox ("Macro stopped.")
Exit Sub
End if

... macro continues here ...

HTH

"Elise148" wrote:

What if the IF statement is IN macro1? Will the "yes" part cause the IF
statement to run AGAIN in the macro? Is there a way to tell it to continue
with the macro, instead of run it from the beginning??


"Toppers" wrote:

If resp = vbYes Then
macro1 '<=== runs macro1
End If


"Elise148" wrote:

What if I want to run the whole macro if the answer is "Yes"...how do I end
the IF statement...right now it looks like...

resp = MsgBox("Do you want to run the macro?", vbYesNo, Confirm)
If resp = vbNo Then
MsgBox ("Macro stopped.")
Exit Sub

If resp = vbYes Then
Run = macro???????????
End If

"Toppers" wrote:


On a MsgBox you can set the YES,NO,CANCEL buttons in msgbox parameters...

resp=Msgbox(........,VbYESNO)

IF resp=vbYES then

IF resp=VbNO then

HTH

"Elise148" wrote:

How would I go about putting a Msg Box in an IF statement in VBA???

For example, I would want to say, if something is clicked in another message
box, proceed with the macro, if something else is clicked, stop the macro?????


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
IF Statement timmadge Excel Worksheet Functions 1 February 7th 06 05:42 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 08:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"