Click on the video to see how it will look like.
Follow the below steps to create a moving title for your userform:
1. Launch Microsoft Excel
2. Press ALT+F11 to open Visual Basic Editor
3. Insert an userform
4. Put a label control on your userform ( say, label 1) and clear the text (delete the text under caption in properties)
5.Put another label (say, label 2) above label 1and write your text in label 2( I wrote "EXCEL VBA TIPS").
See the below image
6. Double click on any userform control, code window will appear.
7. Select "General" as object and paste the below code there as shown in the below image(Click to enlarge)
Code:
Private Sub MoveTitle()
On Error Resume Next
Again:
Label2.Left = Label2.Left - 0.05
DoEvents
For j = 1 To 50000: Next
If Label2.Left + Label2.Width < 0 Then Label2.Left = Me.Width
GoTo Again
End Sub
8. Now select "Userform" as object and "Activate" as procedure and paste the below code there as shown in below image.(Click to enlarge)
Code:
Private Sub UserForm_Activate()
Call MoveTitle
End Sub
Run the userform and your userform title will start moving as shown in the above video.
Did this post help you? Please post your valuable comment. Thanks!!
very helpfull Thanks so much
ReplyDeleteHi Shweta,
ReplyDeleteMind blowing technique but i have a question i hope you will help me in the same i want to do the same thing in worksheet rather than userform what i have to do??
very very useful sir, Thank you very much sir. It is amazing.
ReplyDeleteThank you
DeleteI'm glad to see the great detail here!. venta de cajas de cartón
ReplyDeleteThank you.
Deleteafter making the running text in excel VBA user form, but i can not edit in those excel file.
ReplyDeleteVery helpful. Simple and effective method. Thanks a lot.
ReplyDeleteThank you!!
DeleteThanks for your teaching so easily. Very helpful
ReplyDeleteThank you!!
Deletehow can i do it to move to the right?
ReplyDeleteso helpfull project thanks a lot
ReplyDelete