Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
SetFocus is available only in userforms.
On a worksheet, I believe you need to use activate. -- Regards, Tom Ogilvy "M." wrote in message ... Hi world, i'm using Excel 97. I have two TextBox on sheet, first i wont to type number in first text box, then with pressing ENTER, i would like to set focus to other text box. Why do not apper metod setfocus in suggested list of metod for textbox? Thank's! Milos |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From memory, I don't have 97 on this machine: There's a bug in 97 that won't
let you activate one textbox directly from another. So one has to go to a spreadsheet cell inbetween: Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = 9 Or KeyCode = 13 Then ActiveCell.Activate ' or Select ? DoEvents TextBox2.Activate End If End Sub This code crashes my Excel2000 on Windows XP Pro every time, but I think it was the way to do it with 97. -- HTH. Best wishes Harald Excel MVP Followup to newsgroup only please "Tom Ogilvy" skrev i melding ... SetFocus is available only in userforms. On a worksheet, I believe you need to use activate. -- Regards, Tom Ogilvy "M." wrote in message ... Hi world, i'm using Excel 97. I have two TextBox on sheet, first i wont to type number in first text box, then with pressing ENTER, i would like to set focus to other text box. Why do not apper metod setfocus in suggested list of metod for textbox? Thank's! Milos |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with TAB key and Textbox controls | Excel Programming | |||
SetFocus on a different sheet in VBA | Excel Discussion (Misc queries) | |||
SetFocus problem | Excel Programming | |||
SetFocus method in VBA | Excel Programming | |||
TextBox.SetFocus | Excel Programming |