Create Vertical Scrolling Text in UserForm

Delhi_IT

New Member
Joined
Mar 15, 2018
Messages
9
Trying to create a userform in VBA excel where in the text can be scrolled vertically to show what I add in specific cells of excel. I am using version 2016 of excel.

Have taken VBA code from google which is given below:

Private Sub UserForm_Initialize()
Me.Label1.Caption = Sheet1.Range("b4").Value
Me.Label2.Caption = Sheet1.Range("E9").Value & vbCrLf & vbCrLf & Sheet1.Range("E10").Value & vbCrLf & vbCrLf & Sheet1.Range("E11").Value & vbCrLf & vbCrLf & Sheet1.Range("E12").Value & vbCrLf & vbCrLf & Sheet1.Range("E13").Value
Me.Label2.Top = Me.Height
End Sub

This part of code works well when I comment "Me.Label2.Top = Me.Height" this part of the code.

The second part of the code is for Vertical Scroll where in the scrolling happens however the loop where in the scrolling has to be repeated is not working. Code given below:

Sub verti_scroll()
Call UserForm1.Show(vbModeless)

Do
i = UserForm1.Height - 42

Do
i = i - 1
DoEvents
For a = i To 5000000
a = a + 1
Next
UserForm1.Label2.Top = i
If i = 100 Then GoTo Nextz

Loop
Nextz:
x = x + 1
If x = 2 Then GoTo nextx
Loop
nextx:
End Sub
 
Dear Fluff, Was not aware regarding the cross-post rule. Would make sure to abide by the rules of the Forum.
Then maybe you should comply with what I said before. Namely
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
In that case can you please supply links to ALL sites where you have asked this question.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top