Hi,
I have a userform that is too big to fit on my screen so some elements aren't visible. I originally tried using the scroll bars in properties but that doesn't seem to work (the scrollbars appear on the form but there is no way of moving down).
I searched online and found the following code that gives me a working scrollbar:
However the one issue I'm having is that when I tab between sections on the userform it still stays focussed on the same place, so for example when I tab to a textbox that is off screen it still stays showing the top of the userform, and you can't see it without having to move the scrollbar down.
Is there a way to get the focus of the userform to be on the area that you have tabbed to?
Hope this makes sense!
Thanks in advance for all help!
I have a userform that is too big to fit on my screen so some elements aren't visible. I originally tried using the scroll bars in properties but that doesn't seem to work (the scrollbars appear on the form but there is no way of moving down).
I searched online and found the following code that gives me a working scrollbar:
Code:
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 * 1.25
.ScrollWidth = .InsideWidth * 9
End With
End Sub
However the one issue I'm having is that when I tab between sections on the userform it still stays focussed on the same place, so for example when I tab to a textbox that is off screen it still stays showing the top of the userform, and you can't see it without having to move the scrollbar down.
Is there a way to get the focus of the userform to be on the area that you have tabbed to?
Hope this makes sense!
Thanks in advance for all help!