Afternoon all,
I've managed to come up with a very very simple progress indicator, it's that basic I have simply entered values throughout the code for the %'age of progress which gets called into the "updateprogress" procedure.
Anyway, the way I've got it set up is as follows:
User presses button on worksheet, this activates sub start()
sub start()
userform1.labelprogress.width = 0
userform1.show
end sub
private sub userform_activate()
call q1top10
'q1top10 is the name of my macro which is doing the work
end sub
sub q1top10
dim pctdone
'mainly copy and pasting and vlookups etc
'throughout the code i have as follows:
pctdone = 0.33
call updateprogress(pctdone)
'more code
pctdone = 0.66
call updateprogress(pctdone)
'more code
pctdone = 1
call updateprogress(pctdone)
unload userform1
sub updateprogress(pct)
with userform1
.frameprogress.caption = format(pct,"0%")
.labelprogress.width = pct * (.frameprogress.width - 10)
end with
doevents
My question is this however: I have four command buttons on the worksheet for the users to select results from Q1, Q2, Q3 and Q4. The progress bar is just so they know that the request has been made and its being done, however, do I have to make 4 versions of my progress indicator, or can the private sub userform_activate() sub call different macros depending on what "button" has been pressed to run the sub start()?
Many thanks for your help.
Col
I've managed to come up with a very very simple progress indicator, it's that basic I have simply entered values throughout the code for the %'age of progress which gets called into the "updateprogress" procedure.
Anyway, the way I've got it set up is as follows:
User presses button on worksheet, this activates sub start()
sub start()
userform1.labelprogress.width = 0
userform1.show
end sub
private sub userform_activate()
call q1top10
'q1top10 is the name of my macro which is doing the work
end sub
sub q1top10
dim pctdone
'mainly copy and pasting and vlookups etc
'throughout the code i have as follows:
pctdone = 0.33
call updateprogress(pctdone)
'more code
pctdone = 0.66
call updateprogress(pctdone)
'more code
pctdone = 1
call updateprogress(pctdone)
unload userform1
sub updateprogress(pct)
with userform1
.frameprogress.caption = format(pct,"0%")
.labelprogress.width = pct * (.frameprogress.width - 10)
end with
doevents
My question is this however: I have four command buttons on the worksheet for the users to select results from Q1, Q2, Q3 and Q4. The progress bar is just so they know that the request has been made and its being done, however, do I have to make 4 versions of my progress indicator, or can the private sub userform_activate() sub call different macros depending on what "button" has been pressed to run the sub start()?
Many thanks for your help.
Col