Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default halting macro

Hi again,
lots of questions from here and thanks for all the good answers! Really
helped.

Another question is how to make a dialogbox where you answer a question
(yes or no answer) were a positive answer would continue to run the
reminding macro while a negative answer would halt the macro right
there.

Is there such an code to resolve this as well?

Kind regards

Jonas

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default halting macro

Hi !

put this into a new module : it works !

Option Explicit
Public titre$, defaut$, question$, reponse$
Sub continue_yes_or_no()
'here we start something
titre$ = "Info..."
question$ = "here we are..."
MsgBox question$
'now comes the question
titre$ = "Info..."
question$ = "Shall we continue" & vbCrLf & "---------
<Yes or <No ?"

defaut$ = ""
reponse$ = InputBox(question$, titre$, defaut$)
If Left(UCase(reponse$), 1) = "N" Then
MsgBox "The answer is no: we stop"
Exit Sub
End If
MsgBox "The answer is Yes"
MsgBox "So we continue..."
'and here you go with your code....
'...

End Sub



regards+
Hervé+++
-----Original Message-----
Hi again,
lots of questions from here and thanks for all the good

answers! Really
helped.

Another question is how to make a dialogbox where you

answer a question
(yes or no answer) were a positive answer would continue

to run the
reminding macro while a negative answer would halt the

macro right
there.

Is there such an code to resolve this as well?

Kind regards

Jonas

*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.

Reply
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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
halting macro Jonas O Excel Programming 3 July 9th 03 12:48 PM


All times are GMT +1. The time now is 01:45 PM.

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

About Us

"It's about Microsoft Excel"