LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Keep Object with Focus on Display Screen

I have a page with many objects (textboxes, Option
buttons, comboboxes). There are more objects than can fit
on the display screen. I have used the code below to tab,
shift/tab back and forth between objects on the page

Does anyone know how to code to accomplish the following:

When a field which I have progressivly tabbed into, is
beyond the display screens view (below), I would like the
screen to shift down the page so that the object which I
have tabbed into, which has the focus (e.g.
textbox1.activate) is in my view without me having to
scroll down, or do any extra keystrokes.

Private Sub cboEnergyType_KeyDown(ByVal KeyCode As
MSForms.ReturnInteger, ByVal Shift As Integer)
Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False
bBackwards = CBool(Shift And 1) Or (KeyCode =
vbKeyUp)
If Application.Version < 9 Then Sheet1.Range
("A1").Select
If bBackwards Then
With Me.txtStopPayComments
.Activate
.SelStart = 0
.SelLength = Len(.Text)
End With
Else
With Me.txtAcctNo
.Activate
.SelStart = 0
.SelLength = Len(.Text)
End With
End If
Application.ScreenUpdating = True
End Select
End Sub

Thank you in advance
God bless you
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I fix the position of an object on the screen? Bob Arnett Excel Discussion (Misc queries) 0 October 27th 09 05:46 PM
DISPLAY TWO DIFFERENT SHEETS ON SCREEN [email protected] Excel Discussion (Misc queries) 1 March 22nd 09 08:20 PM
How to add a screen tip to an object (no a hyperlink)? Dudealt Excel Discussion (Misc queries) 1 August 8th 08 06:46 PM
The screen should not move to focus on column using when typing Andeamay Excel Discussion (Misc queries) 1 November 7th 05 01:46 AM
Highlight/Select contents of object with focus andy[_5_] Excel Programming 2 January 15th 04 02:44 PM


All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"