Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using TEXT and &TEXT - display numbers with commas, underline text | Excel Discussion (Misc queries) | |||
Default font for pasted text in text boxes - Excel 2007 | Excel Discussion (Misc queries) | |||
Text does not display in "Text boxs" and when wrapping text in a c | Excel Discussion (Misc queries) | |||
Macro or Function to make text size to suite text Length? | Excel Discussion (Misc queries) | |||
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' | Excel Programming |