[FONT=Fixedsys]Option Explicit[/FONT]
[FONT=Fixedsys][/FONT]
[FONT=Fixedsys]Public Sub DemoProgressBar()[/FONT]
[FONT=Fixedsys][/FONT]
[FONT=Fixedsys] Dim iLoop As Integer[/FONT]
[FONT=Fixedsys][/FONT]
[FONT=Fixedsys] With ThisWorkbook.Sheets("Sheet1")
.ProgressBar1.Value = 0
.ProgressBar1.Min = 0
.ProgressBar1.Max = 100[/FONT]
[FONT=Fixedsys] .ProgressBar1.Visible = True
End With
For iLoop = 1 To 100
[COLOR=green] ' do some processing[/COLOR][/FONT]
[FONT=Fixedsys] With ThisWorkbook.Sheets("Sheet1")
.ProgressBar1 = .ProgressBar1.Value + 1[/FONT]
[FONT=Fixedsys] [COLOR=green] ' or
[/COLOR] .ProgressBar1 = iLoop[/FONT]
[FONT=Fixedsys] End With
Next iLoop
MsgBox "Done!"
With ThisWorkbook.Sheets("Sheet1")
.ProgressBar1.Visible = False
End With
End Sub[/FONT]