pausing a macro for user to have a look

RET79

Well-known Member
Joined
Mar 19, 2002
Messages
526
Hi.

It would sometimes be useful if a big macro I had could have some sort of 'timeout' thing so that the user could check hwo things are going mid-macro and stop it before it makes a complete hash of things.

How would you suggest doing this.

It would be handy to get the user to, after inspecting what the macro has done, have a choice of 2 buttons - OK to continue and cancel to abort macro.

Any suggestions welcomed.

thanks,

RET79
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
On 2002-04-27 15:52, RET79 wrote:
Hi.

It would sometimes be useful if a big macro I had could have some sort of 'timeout' thing so that the user could check hwo things are going mid-macro and stop it before it makes a complete hash of things.

How would you suggest doing this.

It would be handy to get the user to, after inspecting what the macro has done, have a choice of 2 buttons - OK to continue and cancel to abort macro.

Any suggestions welcomed.

thanks,

RET79

Easiest way is to use the Application.Inputbox method
This Function has OK & cancel
Just assign these keys to some routine.
 
Upvote 0
Heres an example of what I mean.

<pre/>
Sub Paused()
Dim YC As Variant

On Error Resume Next
YC = Application.InputBox("Please check the sheets", "Paused for checking")
If YC = False Then
'// User cancelled!
MsgBox "Cancelled"
Else
'// User selected OK
MsgBox YC & " User pressed OK"
End If
On Error GoTo 0

End Sub
</pre>
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,243
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top