J
JT
I found the code below in this forum and would like to try it but I'm having
some difficulty getting it to work.
Suppose I have a spreadsheet with a 100 lines of data and Im doing 'stuff'
to each line. I'd like to have the StatusProgressBar increase as each line
is processed.
I'm guessing:
lCounter = the row being processed
lMax = 100 (for 100 lines)
lInterval = 1 (since I want to change it each time a new row is processed)
I'm not sure of:
(1) what "strText" should be or how it should appear in the code
(2) how to call this code in the code that is processing the 100 lines
Any examples or suggestions on how to make this work would be greatly
appreciated. Thanks for the help........
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub StatusProgressBar(lCounter As Long, lMax As Long, lInterval As Long,
Optional strText As String)
Dim lStripes As Long
If lCounter Mod lInterval = 0 Or lCounter = lMax Then
lStripes = Round((lCounter / lMax) * 100, 0)
Application.StatusBar = strText & String(lStripes, "|") & String(100 -
lStripes, ".") & "|"
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
some difficulty getting it to work.
Suppose I have a spreadsheet with a 100 lines of data and Im doing 'stuff'
to each line. I'd like to have the StatusProgressBar increase as each line
is processed.
I'm guessing:
lCounter = the row being processed
lMax = 100 (for 100 lines)
lInterval = 1 (since I want to change it each time a new row is processed)
I'm not sure of:
(1) what "strText" should be or how it should appear in the code
(2) how to call this code in the code that is processing the 100 lines
Any examples or suggestions on how to make this work would be greatly
appreciated. Thanks for the help........
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub StatusProgressBar(lCounter As Long, lMax As Long, lInterval As Long,
Optional strText As String)
Dim lStripes As Long
If lCounter Mod lInterval = 0 Or lCounter = lMax Then
lStripes = Round((lCounter / lMax) * 100, 0)
Application.StatusBar = strText & String(lStripes, "|") & String(100 -
lStripes, ".") & "|"
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~