vba userforms carriage return behavior

stanigator picture stanigator · Jul 26, 2009 · Viewed 19.1k times · Source

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.

Answer

shahkalpesh picture shahkalpesh · Jul 26, 2009

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