Thread: Progress Bar
View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Progress Bar

Reference the control in the same way you would any other worksheet control,
and code it as you would in a userform, eg

Sub test()
Dim i As Long, nextT As Single
Dim pb As ProgressBar

Set pb = ActiveSheet.OLEObjects("ProgressBar21").Object

pb.Value = 0
pb.Visible = True

For i = 1 To 100
nextT = Timer + 0.05
While Timer < nextT
Wend
nextT = Timer
pb.Value = i
Next
pb.Visible = False

End Sub

Difficult to imagine why your "deliverable", whatever that is, wouldn't
prefer it on a Userform. If you really want it on a sheet there are simpler
ways, eg lengthen a rectangle. Or, if you don't like things "easy" IIRC
Stephen Bullen has a demo on his site to draw a progress bar on a sheet (ie
no control object)

Regards,
Peter T

"Paul W Smith" wrote in message
...
Is it possible to use a progress bar on a worksheet?

I have added the Microsoft ProgressBar Control version 6.0 to my Controls
list in Excel 2007. I can insert the control onto my worksheet but I can
find no way of controling it, or referencing it for that matter.

I am not interested in using the control bar on a userform, that would be
too easy and not waht my deliverable requires!

Paul Smith