VBA Progressbar (Frm73)

Progress bar Frm73 or just simple message
Zip file contains .frm and .frx files to drop into your VBA project

To Initialize, have to call it first:
Frm73.Reset

To End it:
Frm73.Endd

Show certain percintage:
Frm73.Update 220,500,27,40,"Main message","Small secondary message"
Or:
Frm73.Update 220,500,,,"Only main bar"
Or:
Frm73.Update 0,0, 3 , 13 ,"Only small bar"
Or:
Frm73.Update 0,0,,,"Large message" , "And another small message "

Private Sub CmdClose_Click()
CancelIt = 1
End Sub
Sub Reset()
CancelIt = 0
Lbl_Main.Caption = "Loading ..."
Lbl_Small.Caption = ""
Lbl_PrgMain.Width = 0
Lbl_PrgSmall.Width = 0
Frm73.Show 0
DoEvents
End Sub
Sub Update(Val1Main, Val9Main, Optional Val1Small = 0, Optional Val9Small = 0, _
Optional MainMsg = "Reading...", _
Optional SmallMsg = "")

MainW = 0
Messag = MainMsg
If Val9Main > 0 Then
MainW = (Lbl_Main.Width - 2) * Val1Main / Val9Main
Messag = MainMsg & " " & Int(Val1Main * 100 / Val9Main) & _
"% (" & Format(Val1Main, "#,0") & " / " & Format(Val9Main, "#,0") & ")"
End If
Lbl_PrgMain.Width = MainW
Lbl_Main.Caption = Messag

SmallW = 0
If Val9Small > 0 Then SmallW = (Lbl_Main.Width - 2) * Val1Small / Val9Small
Lbl_PrgSmall.Width = SmallW
Lbl_Small.Caption = SmallMsg

DoEvents
'If CancelIt = 1 Then Endd
End Sub
Sub Endd()
Unload Me
End Sub


Parameters

Val1Main, Val9Main, Val1Small, Val9Small, MainMsg, SmallMsg

Views 137 Downloads 52

Perm link


ANmarAmdeen
283
Attachments
UI VBA
Revisions

v1.0