I want to add a progress bar to a macro that I currently use..
I tried this useful link but I could not get the code to work with the macro I am using.
http://www.excelforum.com/excel-prog...gress-bar.html
I already created a form and label, just need to add a progress code to it and activate the form to show when I ran the macro. The above link expects the code to be set in the forms but I have the macro code in a Module. How can I tie the two(code in userforms and code in Module) together and make the progress code to work?
Below is part of the code that keeps looping from the macro. I guess I need to set progress points somewhere in the loop?? but I don't know where or how to. Please help..thx
..
.
.
.
If (fileWS1.Range("C" & sLine).Value = ProdNum) Then
sourceWS.Range("M" & dLine).Value = fileWS1.Range("H" & sLine).Value
preIFF = sourceWS.Range("G" & dLine).Value
Max = fileWS1.Range("H" & sLine).Value
AfterIF = Max * 0.0075 * (sourceWS.Range("A" & dLine).Value)
TotalIF = TotalIF + AfterIF
sourceWS.Range("F" & dLine).Font.ColorIndex = 3
sourceWS.Range("F" & dLine).Font.Bold = True
sourceWS.Range("G" & dLine).Font.ColorIndex = 3
sourceWS.Range("G" & dLine).Font.Bold = True
sourceWS.Range("H" & dLine).Font.ColorIndex = 3
sourceWS.Range("H" & dLine).Font.Bold = True
sourceWS.Range("M" & dLine).Font.ColorIndex = 3
sourceWS.Range("M" & dLine).Font.Bold = True
cFoundEmptyLine = True
sLine = 2
End If
If (fileWS2.Range("C" & sLine).Value = ProdNum) Then
sourceWS.Range("M" & dLine).Value = fileWS2.Range("H" & sLine).Value
preIFF = sourceWS.Range("G" & dLine).Value
Max = fileWS2.Range("H" & sLine).Value
AfterIF = Max * 0.0075 * (sourceWS.Range("A" & dLine).Value)
TotalIF = TotalIF + AfterIF
sourceWS.Range("F" & dLine).Font.ColorIndex = 3
sourceWS.Range("F" & dLine).Font.Bold = True
sourceWS.Range("G" & dLine).Font.ColorIndex = 3
sourceWS.Range("G" & dLine).Font.Bold = True
sourceWS.Range("H" & dLine).Font.ColorIndex = 3
sourceWS.Range("H" & dLine).Font.Bold = True
sourceWS.Range("M" & dLine).Font.ColorIndex = 3
sourceWS.Range("M" & dLine).Font.Bold = True
cFoundEmptyLine = True
sLine = 2
End If
If (fileWS3.Range("C" & sLine).Value = ProdNum) Then
sourceWS.Range("M" & dLine).Value = fileWS3.Range("H" & sLine).Value
preIFF = sourceWS.Range("G" & dLine).Value
Max = fileWS3.Range("H" & sLine).Value
AfterIF = Max * 0.0075 * (sourceWS.Range("A" & dLine).Value)
TotalIF = TotalIF + AfterIF
sourceWS.Range("F" & dLine).Font.ColorIndex = 3
sourceWS.Range("F" & dLine).Font.Bold = True
sourceWS.Range("G" & dLine).Font.ColorIndex = 3
sourceWS.Range("G" & dLine).Font.Bold = True
sourceWS.Range("H" & dLine).Font.ColorIndex = 3
sourceWS.Range("H" & dLine).Font.Bold = True
sourceWS.Range("M" & dLine).Font.ColorIndex = 3
sourceWS.Range("M" & dLine).Font.Bold = True
cFoundEmptyLine = True
sLine = 2
End If
If (fileWS4.Range("C" & sLine).Value = ProdNum) Then
sourceWS.Range("M" & dLine).Value = fileWS4.Range("H" & sLine).Value
preIFF = sourceWS.Range("G" & dLine).Value
Max = fileWS4.Range("H" & sLine).Value
AfterIF = Max * 0.0075 * (sourceWS.Range("A" & dLine).Value)
TotalIF = TotalIF + AfterIF
sourceWS.Range("F" & dLine).Font.ColorIndex = 3
sourceWS.Range("F" & dLine).Font.Bold = True
sourceWS.Range("G" & dLine).Font.ColorIndex = 3
sourceWS.Range("G" & dLine).Font.Bold = True
sourceWS.Range("H" & dLine).Font.ColorIndex = 3
sourceWS.Range("H" & dLine).Font.Bold = True
sourceWS.Range("M" & dLine).Font.ColorIndex = 3
sourceWS.Range("M" & dLine).Font.Bold = True
cFoundEmptyLine = True
sLine = 2
If (fileWS1.Range("C" & sLine).Value = "") Then
cFoundEmptyLine = True
sLine = 1
End If
End If
sLine = sLine + 1
If (fileWS1.Range("C" & sLine).Value = "") Then
cFoundEmptyLine = True
sLine = 1
End If
Loop
cFoundEmptyLine = False
dLine = dLine + 1
Else
bFoundEmptyLine = True
End If
End If
Loop
Bookmarks