Do Until

  • Thread starter Thread starter wolfgang
  • Start date Start date
W

wolfgang

can someone help me with this loop. i am not too
familiar with it. i have a userform with a label. i
want the label to swoosh across the form from left = 300
to left =6. so i want the lable to start at left = 300
and slowly scroll across until left =6 TIA.
 
Wolfgang,

Try something like

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As
Long)
Private Sub CommandButton1_Click()
Dim Pos As Single
For Pos = 300 To 6 Step -1
Me.Repaint
Sleep 1
Me.Label1.Left = Pos
Next Pos
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
This subroutine will do what you described using a for
loop, as I believe that would be more appropriate.

Sub MoveLabel()
Dim i As Single
For i = 300 To 0 Step -0.1
Label1.Left = i
Next
End Sub

HTH.
 
Back
Top