#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default 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.
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"