Form Textbox Mulitline question

C

Corey ....

I am using a form to enter data into a cell in another sheet.
The form Textbox has mulitline enabled. It works fine, however:
When there is more than 1 line of text needed, the user hits the Enter Key
on the keyboard, to naviaget to the next line.
All looks well on the form, but when the data is produced on the sheet, each
Enter Key used places a small square Box(charater) in the cell with
multiline enabled.

The lines of text do move to the next line as required, but they have the
small square box as the last charater.
Is there any way to not display the small square box character in the cell?
Like a lkine of code that removes the character, but still maintaining the
correct multiline format?

Corey....
 
D

Dave Peterson

You could provide a macro that replaces the carriage return with nothing.

worksheets("Sheet1").range("A1").value _
= replace(me.textbox1.text, vbcr, "")

The textbox contains a carriage return and line feed. The line feed (chr(10) or
vblf) should be kept to force a new line within the cell, right?
 
D

Dave Peterson

ps.

Replace was added in xl2k. You could use application.substitute if you're using
xl97.
 
C

Corey ....

Perfect!

Thanks Dave.


Dave Peterson said:
You could provide a macro that replaces the carriage return with nothing.

worksheets("Sheet1").range("A1").value _
= replace(me.textbox1.text, vbcr, "")

The textbox contains a carriage return and line feed. The line feed
(chr(10) or
vblf) should be kept to force a new line within the cell, right?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top