ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Advancing Cursor (https://www.excelbanter.com/excel-programming/397844-advancing-cursor.html)

WLMPilot

Advancing Cursor
 
I have a userform with a combobox and two text boxes. Currently, I can only
advance the cursor from one box to another with the right tab key. How can I
change it so that the ENTER key advances the cursor to the next box?

Thanks,
Les

Pranav Vaidya

Advancing Cursor
 
Use the Keydown event of TextBox1 as

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then TextBox2.SetFocus
End Sub

Hope this helps!!
--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"WLMPilot" wrote:

I have a userform with a combobox and two text boxes. Currently, I can only
advance the cursor from one box to another with the right tab key. How can I
change it so that the ENTER key advances the cursor to the next box?

Thanks,
Les


Jim Cone

Advancing Cursor
 

In the properties window of the VBE, set the EnterKeyBehavior to False
for each text box.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"WLMPilot"
wrote in message
I have a userform with a combobox and two text boxes. Currently, I can only
advance the cursor from one box to another with the right tab key. How can I
change it so that the ENTER key advances the cursor to the next box?
Thanks,
Les


All times are GMT +1. The time now is 10:39 AM.

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