Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Let user break out of a big computation?
I have a Userform which contains two buttons. One buttons
says "Begin" and the other button says "Cancel". If the user presses "Begin", my macro will begin processing a potentially long computation. Once the computation begins, can I allow the user to press the "Cancel" button to break out of the big computation?? Is that possible? Additionally, is it possible to display some sort of progress bar to display a percentage which shows how much of the computation is complete? Would I need some sort of plug control for this? Or can I just simply update a text label on the form to show percentage completed?? Thank you! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Let user break out of a big computation?
Hi
If your code knows how much is done and how much is left, then a progress function is easy, simple percentage calculation. http://spreadsheetpage.com/index.php...ndicator_demo/ If you know the steps but not the time, this is a good way of visualizing the progress: http://www.dailydoseofexcel.com/arch...-progress-bar/ As for stopping the procedure, here is a very simple demo. All it does is count up in the statusbar (lower left corner of Excel): Option Explicit Dim StopIt As Boolean Sub BtnStartCode() Dim m As Long, n As Long StopIt = False For m = 1 To 10000 DoEvents If StopIt = True Then Exit Sub For n = 1 To 999 Application.StatusBar = m * 1000 + n Next Next End Sub Sub BtnCancelCode() StopIt = True End Sub HTH. Best wishes Harald "Robert Crandal" wrote in message ... I have a Userform which contains two buttons. One buttons says "Begin" and the other button says "Cancel". If the user presses "Begin", my macro will begin processing a potentially long computation. Once the computation begins, can I allow the user to press the "Cancel" button to break out of the big computation?? Is that possible? Additionally, is it possible to display some sort of progress bar to display a percentage which shows how much of the computation is complete? Would I need some sort of plug control for this? Or can I just simply update a text label on the form to show percentage completed?? Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Age computation | Excel Programming | |||
Date Computation | Excel Programming | |||
Overtime computation and lunch break formula with IF and AND | Excel Worksheet Functions | |||
links in cells break and revert to user profile location | Excel Discussion (Misc queries) | |||
User initiated break/actions during macro execution | Excel Programming |