View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bonnie[_6_] Bonnie[_6_] is offline
external usenet poster
 
Posts: 2
Default Macro continues to run


"Rob" wrote in message
...
Hi,
The following code works well with the exception that when the Message Box
appears and the cursor is moved off the Message Box on to the worksheet
the
hour glass appears instead of the mouse pointer. I presume this means that
the macro is still running.

Sub CheckVolumeRise1()
If Range("g6") < Range("h6") < Range("k6") Then
MsgBox Range("a6") & " has reached criteria"
End If
End Sub

Please will someone advise me on what to do.

Thank you.


Rob,

You are correct. Until you click a button in the message box, in your case
the 'OK' button, the macro is still running. You see the hourglass because
it is awaiting a reply to the message box. Once you click a button in the
message box, the code resumes at the line immediately following the MsgBox
line.

An option to avoid having to click a button in the message box is to create
a userform or a textbox and make it visible for a few seconds and then hide
it. This way your code can continue uninterrupted without requiring user
input of any kind.

HTH,

Bonnie