userform scroll bar fix needed

Sharid

Well-known Member
Joined
Apr 22, 2007
Messages
1,064
Office Version
  1. 2016
Platform
  1. Windows
I have a user form, I have set the user form properties so that I have a vertical scroll bar.
<o:p> </o:p>
The user form scroll height is 400 and
Scroll Top is at 0
<o:p> </o:p>
In the visual basic editor, the scroll bar is at the top of the form
<o:p> </o:p>
The problem I have is that when the user form opens the scroll bar is half way down. I have to drag it back to the top. I saw this problem on another form but there was not an answer for it.
<o:p> </o:p>
Can some one help?:(
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
In the properties, do you have a control source set for the scrollbar? what about a value?

Scroll top just tells it where to physically place the scrollbar on the form, not what its value will be.
 
Upvote 0
In the properties, do you have a control source set for the scrollbar? what about a value?

Scroll bar is part of the user form, it was not added via the VB Tool box. I have checked the properties and I can't find any properties for control source or value

or am I doing something wrong?:confused:
 
Upvote 0
If it wasn't added via the VBA toolbox, how was it added?

As long as you've got access to the UserForm's code, you could set the value of the ScrollBar when the userform initialises:
Code:
Private Sub UserForm_Initialize()
Me.ScrollBar1.Value = 0
End Sub
.......obviously change the scrollbar name to suite.
 
Upvote 0
If it wasn't added via the VBA toolbox, how was it added?

scroll bar was added via properties of the suer from, I used the drop down option to choose 2-fmScrollBarsVertival

I did not do via the toolbox and choose the scroll bar:p
 
Upvote 0
Okay. Maybe try this - not tested much though:

Code:
Private Sub UserForm_Activate()
    Me.Scroll fmScrollActionBegin, fmScrollActionBegin
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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