ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform text box (https://www.excelbanter.com/excel-programming/276654-re-userform-text-box.html)

John Wilson

Userform text box
 
Kimberly,

Try one of the following:

If you're using xl2k or above, you can use:
TextBox1.Value = Replace(TextBox1.Value,Chr(10),"")

If xl97 or below:
TextBox1.Value = Application.Substitute(TextBox1.Value,Chr(10),"")

You can replace the "" with a " " if you want a space in there instead.

John

KimberlyC wrote:

Hi
I have a user form that has a text box to allow a user to enter a memo in
it. It's set to be mutliple lines and the enter key cursors to the next line
when pressed. I then have a command button that has code attached to it
that takes the text entered in the text box and places it in a range on a
worksheet.

This works well, however, there are characters at the end of each line in
the transferred text on the worksheet that looks like a sqaure box..
How do I get the text from the user from textbox to the worksheet without
those added characters at the end of each line (the character appears to be
from the user pressing the enter key to move to the next line)?

Thanks in advance!!
Kimberly




All times are GMT +1. The time now is 12:29 PM.

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