ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Carriage return in macros (https://www.excelbanter.com/excel-worksheet-functions/6418-carriage-return-macros.html)

Manu Palao

Carriage return in macros
 

Hi
I would like to write a list of words on a TextBox of a UserForm; how
can I specifiy the Carriage return character in the "TextBox.Text="
sentence?
Thanks!!


--
Manu Palao
------------------------------------------------------------------------
Manu Palao's Profile: http://www.excelforum.com/member.php...o&userid=16205
View this thread: http://www.excelforum.com/showthread...hreadid=278272


Chip Pearson

Manu,

Try code like the following:

Me.TextBox1.MultiLine = True
Me.TextBox1.Text = "Line One" & vbNewLine & _
"Line Two" & vbNewLine & _
"Line Three"

For aesthetic reasons, you might want to use a ListBox control
rather than a TextBox control.



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Manu Palao" wrote in
message ...

Hi
I would like to write a list of words on a TextBox of a
UserForm; how
can I specifiy the Carriage return character in the
"TextBox.Text="
sentence?
Thanks!!


--
Manu Palao
------------------------------------------------------------------------
Manu Palao's Profile:
http://www.excelforum.com/member.php...o&userid=16205
View this thread:
http://www.excelforum.com/showthread...hreadid=278272





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

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