ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Do Until (https://www.excelbanter.com/excel-programming/288938-do-until.html)

wolfgang

Do Until
 
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.

chandlm[_11_]

Do Until
 
I have attached a quick form showing how to do this.

Hope this is what you were after

Attachment filename: labelleft.zip
Download attachment: http://www.excelforum.com/attachment.php?postid=418254
---
Message posted from http://www.ExcelForum.com/


Chip Pearson

Do Until
 
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

"wolfgang" wrote in message
...
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.




Brad[_10_]

Do Until
 
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.

-----Original Message-----
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.
.



All times are GMT +1. The time now is 08:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com