Progress bar in VBA

V

Vinay

Hi,
I want to know " How to create progress bar in VBA".
Plz suggest something.

regds
vinay
 
T

Taylor79

In VBA on your toolbox you want to right click and (Add Addition Controls)
then you need to Select Microsoft ProgressBar Control 6.0 (SP4)
click ok and then add your progress bar where you need it.

the following code will Scroll a Textbox or Label or Caption.



l0012 = "Connecting To Database ." 'Put String Here
l0013 = Len(l0012) 'String Char Count
For i = 1 To l0013 'Dim i for Loop
l0014 = Mid(l0012, 1, i) 'Get 1 Char in String at a time
l0015 = (100 / l0013) * i 'Set Value for Progress Bar
Me.Caption = l0014 'Scroll Each Letter in String + 1
Me.ProgressBar1.Value = l0015 'Progress Bar
Pause (0.05) 'Pause
Next i 'Loop To Next


End Sub

Sub Pause(interval)
Dim current
current = Timer
Do While Timer - current < Val(interval)
DoEvents
Loop
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top