A G
asked on
Scrollbar Position on VBA Excel Userform
When I open my userform , the horizontal scollbar starts form the middle of the page instead of the top. How can solve this problem?
thanks,
thanks,
set the default "value" property of the scroll bar to 0
ASKER
Ok, how do you do that in the code ?
With Me
ScrollBars = fmScrollBarsBoth
.ScrollHeight = .InsideHeight * 1.2
.ScrollWidth = .InsideWidth * 1.2
.ScrollLeft = 3
.ScrollTop = 2
End With
With Me
ScrollBars = fmScrollBarsBoth
.ScrollHeight = .InsideHeight * 1.2
.ScrollWidth = .InsideWidth * 1.2
.ScrollLeft = 3
.ScrollTop = 2
End With
sorry, I thought you were refering to a scrollbar control that you had added to the form, not the scroll bar of the form itself.
Does it work like you want if you cange the left and top properties to 0? Maybe Im confused with what you are asking.
.ScrollLeft = 0
.ScrollTop = 0
Does it work like you want if you cange the left and top properties to 0? Maybe Im confused with what you are asking.
.ScrollLeft = 0
.ScrollTop = 0
ASKER
No it doesnt work.
Ok so this is what happens.
WHen i open the userform. The scrollbar is scrolled to bottom. so It does not start from the top of the userform (bottom part is visible at first), because it is scrolled down to bottom.
Ok so this is what happens.
WHen i open the userform. The scrollbar is scrolled to bottom. so It does not start from the top of the userform (bottom part is visible at first), because it is scrolled down to bottom.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Which control on your form is first in the tab order? Is it one at the bottom?