Private Sub UserForm_Activate()
Dim remainder As Long
Dim i As Long, j As Long
remainder = 0
For i = 1 To 200
UserForm1.Label2.Width = UserForm1.Label2.Width + 1
If i Mod 2 = 0 Then
remainder = remainder + 1
UserForm1.Caption = remainder & " % complete"
UserForm1.Label2.Caption = remainder & "%"
End If
For j = 1 To 600
DoEvents
Next j
Next i
BackColor = &HFFFF&
MsgBox "File has been loaded succesfully!"
Unload UserForm1
End Sub
Private Sub UserForm_Activate()
Dim remainder As Long
Dim i As Long, j As Long
remainder = 0
For i = 1 To 200
UserForm1.Label2.Width = UserForm1.Label2.Width + 1
If i Mod 2 = 0 Then
remainder = remainder + 1
UserForm1.Caption = remainder & " % complete"
UserForm1.Label2.Caption = remainder & "%"
End If
For j = 1 To 600
DoEvents
Next j
Next i
UserForm1.Label2.BackColor = &HFFFF&
MsgBox "File has been loaded succesfully!"
Unload UserForm1
End Sub
Does this work for you?
Code:Private Sub UserForm_Activate() Dim remainder As Long Dim i As Long, j As Long remainder = 0 For i = 1 To 200 UserForm1.Label2.Width = UserForm1.Label2.Width + 1 If i Mod 2 = 0 Then remainder = remainder + 1 UserForm1.Caption = remainder & " % complete" UserForm1.Label2.Caption = remainder & "%" End If For j = 1 To 600 DoEvents Next j Next i BackColor = &HFFFF& MsgBox "File has been loaded succesfully!" Unload UserForm1 End Sub
I actually like this one better
Code:Private Sub UserForm_Activate() Dim remainder As Long Dim i As Long, j As Long remainder = 0 For i = 1 To 200 UserForm1.Label2.Width = UserForm1.Label2.Width + 1 If i Mod 2 = 0 Then remainder = remainder + 1 UserForm1.Caption = remainder & " % complete" UserForm1.Label2.Caption = remainder & "%" End If For j = 1 To 600 DoEvents Next j Next i UserForm1.Label2.BackColor = &HFFFF& MsgBox "File has been loaded succesfully!" Unload UserForm1 End Sub