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. |
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/ |
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. |
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