Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default I want 'Enter' to be a line break in a text-box

I want to be able to type text into a multi-line text-box on a form,
and when I hit the Enter key, I want it to insert a line-break (hard
or soft) or paragraph break so that I can then type on the next line.

At the moment, when I press Enter, it moves to the next control on the
form.

(When I'm not in the text-box,I'm happy for Enter to just do what it
normally does.)

Is this possible?

M
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default I want 'Enter' to be a line break in a text-box

Set the MultiLine property to True and set the EnterKeyBehavior
property to True. You can do this manually in the designer's
Properties window or with code when the form loads:

Private Sub UserForm_Initialize()
With Me.TextBox1
.MultiLine = True
.EnterKeyBehavior = True
End With
End Sub

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Tue, 25 Nov 2008 06:12:49 -0800 (PST), Michelle
wrote:

I want to be able to type text into a multi-line text-box on a form,
and when I hit the Enter key, I want it to insert a line-break (hard
or soft) or paragraph break so that I can then type on the next line.

At the moment, when I press Enter, it moves to the next control on the
form.

(When I'm not in the text-box,I'm happy for Enter to just do what it
normally does.)

Is this possible?

M

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alt+Enter not giving me a line break Benongo Excel Worksheet Functions 2 November 7th 07 02:51 AM
ALT+ENTER = line break Nyla Excel Discussion (Misc queries) 14 July 26th 07 03:07 AM
Auto-Insert Line Break (Alt+Enter)? o1darcie1o Excel Discussion (Misc queries) 4 October 25th 06 08:29 PM
Why can't I get 'alt enter' to create a line break in Excel? babbott Excel Discussion (Misc queries) 3 May 9th 06 12:18 AM
How do I enter a line break within a cell? Striving for efficiency Excel Discussion (Misc queries) 4 November 17th 05 08:10 PM


All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"