View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default On Form Start Up

change

Private Sub CommandButton2_Click()
DemoProgress1
End Sub

To

Private Sub Userform_Activate()
DemoProgress1
End Sub

--
Regards,
Tom Ogilvy


"ceemo" wrote in
message ...

Private Sub UserForm_Initialize()

' ProgressBar1
labPg1.Tag = labPg1.Width
labPg1.Width = 0
labPg1v.Caption = ""
labPg1va.Caption = ""




End Sub


Private Sub CommandButton2_Click()

DemoProgress1


End Sub


Sub DemoProgress1()
'
' Progress Bar
'
Dim intIndex As Integer
Dim sngPercent As Single
Dim intMax As Integer
Application.Cursor = xlWait
intMax = 25
For intIndex = 1 To intMax
sngPercent = intIndex / intMax
ProgressStyle1 sngPercent, True
DoEvents
'------------------------
' Your code would go here
'------------------------
Sleep 100
Next
Application.Cursor = xlDefault
Unload Me
End Sub


--
ceemo
------------------------------------------------------------------------
ceemo's Profile:

http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=482433