This is because you have exceeded the maximum value. try it
For Each rc In Selection
If UserForm1.ProgressBar1.Value < UserForm1.ProgressBar1.Max Then
UserForm1.ProgressBar1.Value = UserForm1.ProgressBar1.Value + 1
End If
Next
By the way, I forgot to mention vbModelessafterUserForm1.Show
Explanation
, , . , value = 1 value = 5, , , 1 5, .
Sub ShowProgressBar()
Dim lAllCnt As Long
Dim rc As Range
lAllCnt = Selection.Count
With UserForm1
.Show vbModeless
With .ProgressBar1
.Min = 1
.Max = lAllCnt
For Each rc In Selection
If .Value < .Max Then
.Value = .Value + 1
End If
Next
End With
End With
'~~> I have uncommented it so that you can see the
'~~> Userform with the progress bar with it values
'Unload UserForm1
End Sub