![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: England, UK.
Posts: 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 |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
This Function has OK & cancel Just assign these keys to some routine. |
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Heres an example of what I mean.
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 |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: England, UK.
Posts: 526
|
Ivan, that's perfect.
Thanks so much, RET79 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|