Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Nelp required to integrate ProgressBar
I seem to be struggling with how to integrate the progress bar vb
codes with the main program events. Currently, the main program is executed through a userform that requests for a password to start (the userform is programmed to call the main event). Then the problem i'm having is where to position or attach the progress bar codes to: below is an example i'm trying to follow: And obviously it needs to call a program? Please note, I have set up the bar indicator in userform1. Sub Main() ' Inserts random numbers on the active worksheet Dim Counter As Integer Dim RowMax As Integer, ColMax As Integer Dim r As Integer, c As Integer Dim PctDone As Single If TypeName(ActiveSheet) < "Worksheet" Then Exit Sub Cells.Clear Application.ScreenUpdating = False Counter = 1 RowMax = 100 ColMax = 25 For r = 1 To RowMax For c = 1 To ColMax Cells(r, c) = Int(Rnd * 1000) Counter = Counter + 1 Next c PctDone = Counter / (RowMax * ColMax) With UserForm1 .FrameProgress.Caption = Format(PctDone, "0%") .LabelProgress.Width = PctDone * (.FrameProgress.Width - 10) End With ' The DoEvents statement is responsible for the form updating DoEvents Next r Unload UserForm1 End Sub Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I integrate MapPoint into Excel? | Excel Discussion (Misc queries) | |||
how can I integrate in Excel? | Excel Discussion (Misc queries) | |||
How Do I Integrate? | Excel Discussion (Misc queries) | |||
integrate | Charts and Charting in Excel | |||
How to integrate cells from different .xls into one consolidation | Excel Discussion (Misc queries) |