scroll bar in userform

robfo0

Active Member
Joined
Feb 19, 2002
Messages
281
hi everyone, having a bit of a problem. Ive looked in the help index and searched this board but found nothing. I need to put a vertical scroll bar in my userform because it is too long to view. I added one, but it doesnt work. Do i have to add some code to make it work? if so, what? thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I think you can accomplish this in an easier fashion.

Userforms have 6 properties (If i remember correctly) that relate directly to ScrollBars.

Set the .ScrollBars property to 2
Now, set the .ScrollTop to 0 (So it will appear always at the top of the form)

and finally, you must change the .ScrollBarHeight to something... for example, If the UserForm height is 100, try setting this property to 200 and see how that works. There's a more "elegant" way of finding this number, but, this works as well.
 
Upvote 0
perfect! thanks juan, i saw the properties in there, but missed the "scrollbars" option. Thanks once again!
 
Upvote 0
Juan Pablo -so here it is several years later, and I needed this very thing. It was most helpful.Thank you!

Antonio.
 
Upvote 0
I've scrolltop = 0 and still, upon opening the bar is close to the bottom.

how do I fix it so the bar opens on the top (scrolltop = 0)
---I did place Me.scrolltop = 0 under initialize and it didnt work
 
Upvote 0
ScrollTop = 0 in the initial phase

for some reason, activate is needed:
Private Sub UserForm_Activate()
With Me
'This will create a vertical scrollbar
'' .ScrollBars = fmScrollBarsVertical

'Change the values of 2 as Per your requirements
' .ScrollHeight = .InsideHeight * 2
'.ScrollWidth = .InsideWidth * 9
.ScrollTop = 0
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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