J
Jeff Roper
Hello, I need to know how to enter a loop into this module listed below
The loop is listed below this module.
Sub ProgBarDemo()
Dim PB As clsProgBar
Dim nCounter As Integer
Dim lWaitCount As Long
Set PB = New clsProgBar
With PB
.Title = "Enhanced Datasystems Progress Bar"
.Caption2 = "This is caption 2"
.Caption3 = "This is caption 3"
.Show
For nCounter = 0 To 100
.Progress = nCounter
.Caption1 = "Progress message " & CStr(nCounter)
For lWaitCount = 0 To 1000000
If UserCancelled = True Then GoTo EndRoutine
Next lWaitCount
Next nCounter
EndRoutine:
.Finish
End With
Set PB = Nothing
End Sub
----------------------------------------
** Loop ** -- Changes a percentage (M7) + or - .000001 to make on
number (J16) equal another (L16).
----------------------------------------
Application.ScreenUpdating = False 'Part of screen flashin
turn-off
Range("M7").Value = 0.09 'Set value of cell "M7"
If Range("J16") < Range("L16") Then 'Test for condition <
Do While Not Range("J16") = Range("L16")
Range("M7") = Range("M7") + 0.000001
Loop
ElseIf Range("J16") > Range("L16") Then 'Test for condition >
Do While Not Range("J16") = Range("L16")
Range("M7") = Range("M7") - 0.000001
Loop
End If
Range("K16").Interior.ColorIndex = 50 'Change color of equa
signs
Range("J7").Interior.ColorIndex = 50 'Change color of Total
Range("L14:L15").Interior.ColorIndex = 50 'Change color of Gran
Total
Application.ScreenUpdating = True 'Part of screen flashin
turn-of
The loop is listed below this module.
Sub ProgBarDemo()
Dim PB As clsProgBar
Dim nCounter As Integer
Dim lWaitCount As Long
Set PB = New clsProgBar
With PB
.Title = "Enhanced Datasystems Progress Bar"
.Caption2 = "This is caption 2"
.Caption3 = "This is caption 3"
.Show
For nCounter = 0 To 100
.Progress = nCounter
.Caption1 = "Progress message " & CStr(nCounter)
For lWaitCount = 0 To 1000000
If UserCancelled = True Then GoTo EndRoutine
Next lWaitCount
Next nCounter
EndRoutine:
.Finish
End With
Set PB = Nothing
End Sub
----------------------------------------
** Loop ** -- Changes a percentage (M7) + or - .000001 to make on
number (J16) equal another (L16).
----------------------------------------
Application.ScreenUpdating = False 'Part of screen flashin
turn-off
Range("M7").Value = 0.09 'Set value of cell "M7"
If Range("J16") < Range("L16") Then 'Test for condition <
Do While Not Range("J16") = Range("L16")
Range("M7") = Range("M7") + 0.000001
Loop
ElseIf Range("J16") > Range("L16") Then 'Test for condition >
Do While Not Range("J16") = Range("L16")
Range("M7") = Range("M7") - 0.000001
Loop
End If
Range("K16").Interior.ColorIndex = 50 'Change color of equa
signs
Range("J7").Interior.ColorIndex = 50 'Change color of Total
Range("L14:L15").Interior.ColorIndex = 50 'Change color of Gran
Total
Application.ScreenUpdating = True 'Part of screen flashin
turn-of