ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Control Scroll bar (https://www.excelbanter.com/excel-programming/348865-control-scroll-bar.html)

mcroozer

Control Scroll bar
 

I am building a form in Excel using textboxes with some VB behind them.
I am new to this and I'm sure there is an easier way to build my form
but it's too late to turn around now.

I have 25 or so textboxes on the left side of the form. When I get t
textbox 22, the focus is below the viewable screen. The scroll ba
does not move with my tab order. If I tab a few more times, the focu
is returned to the textboxes on the upper right of my form.

I need to get the scroll bar to move to the bottom when I reach the en
of the screen and to the top when I go back up. Is this an Exce
setting that I am missing or can I control the scrollbar with some VB?
Thanks for your time - Mcroozer

--
mcrooze
-----------------------------------------------------------------------
mcroozer's Profile: http://www.excelforum.com/member.php...fo&userid=2987
View this thread: http://www.excelforum.com/showthread.php?threadid=49581


Leith Ross[_419_]

Control Scroll bar
 

Hello Mcroozer,

Here are the macros to move the scrollbar up and down.
____________________________


Code:
--------------------
[color=blue]
Sub ScrollUp()

Dim Y As Long

Y = Application.ActiveWindow.ScrollRow
If Y 1 Then
Application.ActiveWindow.ScrollRow = Y - 1
End If

End Sub

Sub ScrollDown()

Dim Y As Long

Y = Application.ActiveWindow.ScrollRow
If Y < 65536 Then
Application,ActiveWindow.ScrollRow = Y + 1
End If

End Sub
_____________________________

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=495819



All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com