Keep focus in userform textbox when press enter

fridaywizard

New Member
Joined
Jan 4, 2012
Messages
6
Hello

I've got a userform with a textbox (TextBox1) in Excel 2003. When the user types into TextBox1 and presses enter I want it to act as it would e.g. in a Word document where the cursor moves to the next row down.

I know that if you press shift+enter the cursor moves down but for the intended audience it would be a lot easier to have it act like Word.

Does anyone know of any code that will do this?

Thanks a lot

Nick
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Warship

Well-known Member
Joined
Jul 17, 2007
Messages
1,051
try:
Code:
TextBox1.MultiLine = True
TextBox1.EnterKeyBehavior = True
 

Watch MrExcel Video

Forum statistics

Threads
1,095,364
Messages
5,444,025
Members
405,260
Latest member
Khauff

This Week's Hot Topics

Top