I HAVE looked at loads of examples & explanations 'out-there' but I'm still no wiser. I have a looping procedure that will take a file name
from cells in Row B
and I want that file name to appear in a Label in a Progress Bar, so I have put this code next:-
At which point it goes to the code in 'Forms; UserForm1'
that I obviously got from elsewhere(!).
And that's where it appears to stop! If I manually Close down (X) the Progress Bar Form, I get back to the code.
(I have already declared 'ILC' & 'SWB' as 'Public' in the Declarations section, so I don't think I have a problem with them.)
What I need to know is how to get back into my running code to do the rest of the looping, updating the Progress Bar each time.
I hope it's just my ignorance and someone can point out where I'm going wrong.
Many thanks (in advance)
Des.
Code:
"SWB" (Source WorkBooK0
Code:
For c = 2 To SLC 'Column B to End Column of Source data - Source Last Column
Code:
UserForm1.Label1.Caption = SWB
UserForm1.Show
Code:
Private Sub UserForm_activate()
Call Main
End Sub
Code:
Sub Main()
Dim Counter As Integer
Dim PctDone As Single
Application.ScreenUpdating = False
Counter = Counter + 1
PctDone = Counter / ILC
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
End Sub
And that's where it appears to stop! If I manually Close down (X) the Progress Bar Form, I get back to the code.
(I have already declared 'ILC' & 'SWB' as 'Public' in the Declarations section, so I don't think I have a problem with them.)
What I need to know is how to get back into my running code to do the rest of the looping, updating the Progress Bar each time.
I hope it's just my ignorance and someone can point out where I'm going wrong.
Many thanks (in advance)
Des.