vba userforms carriage return behavior

calendar_today Asked Jul 25, 2009
thumb_up 18 upvotes
history Updated April 16, 2026

Question posted 2009 · +7 upvotes

In a textbox of a userform in VBA, I would like to enable the feature where the user can add a new line in the textbox by pressing the “Enter” key on the keyboard. However, I had trouble finding a UI option in the UI editor to achieve this. Is this even allowed in VBA userforms? Thanks in advance for the advices and answers.

Accepted answer +18 upvotes

Set textbox’s MultiLine property to True and EnterKeyBehavior to True.

Top excel-vba Q&A (6)

+18 upvotes ranks this answer #21 out of 136 excel-vba solutions on this site — top 15%.