Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Tab from one Text Box to a different Text Box

I am creating a user interface using text boxes (activex controls) and
I want to be able and tab from one text box to the next. The text
boxes are located on the sheet itself not in a form. Does anyone know
if this can be done.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Tab from one Text Box to a different Text Box

Here is code Rob Bovey previously posted related to tabbing through controls
on a worksheet:

From: Rob Bovey )
Subject: Worksheet Controls

Newsgroups: microsoft.public.excel.programming
Date: 2000/07/22


Hi Fabio,

<<1 - Is there a way to establish the tab order of worksheet controls, or
even
have the Tab or Enter key select them continuously ( as they do in cells)?

There's no automatic way of doing it that I know. You have to do it
yourself
using the KeyDown event for each of the controls on your worksheet. If the
KeyCode argument of the KeyDown event for a given control tells you that TAB
or
ENTER has been pressed, you explicitly activate the control that you want to
be
next in line. Here's a simple example:

Private Sub TextBox2_KeyDown( _
ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
''' Check if the TAB or ENTER key was pressed.
If KeyCode = vbKeyTab Or KeyCode = vbKeyReturn Then
''' If this is Excel 97 you must select a cell
''' before attempting to activate another control.
If Val(Application.Version) < 9 Then
Me.Range("A1").Select
End If
''' Move the focus appropriately.
If CBool(Shift And 1) Then
''' The user was holding down the SHIFT key
''' move back to the previous control.
TextBox1.Activate
Else
''' Move to the next control.
TextBox3.Activate
End If
End If
End Sub
-----------------------

--
Regards,
Tom Ogilvy

German wrote in message
om...
I am creating a user interface using text boxes (activex controls) and
I want to be able and tab from one text box to the next. The text
boxes are located on the sheet itself not in a form. Does anyone know
if this can be done.

Thanks.



Reply
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
Using TEXT and &TEXT - display numbers with commas, underline text Gary Excel Discussion (Misc queries) 3 May 5th 23 03:46 AM
Default font for pasted text in text boxes - Excel 2007 MS OFFICE USER EIT Excel Discussion (Misc queries) 0 March 25th 10 09:01 PM
Text does not display in "Text boxs" and when wrapping text in a c Esteban Excel Discussion (Misc queries) 1 March 8th 07 11:59 PM
Macro or Function to make text size to suite text Length? lbbss Excel Discussion (Misc queries) 4 December 14th 04 07:53 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


All times are GMT +1. The time now is 09:48 AM.

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

About Us

"It's about Microsoft Excel"