ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Form Textbox Mulitline question (https://www.excelbanter.com/excel-programming/429999-form-textbox-mulitline-question.html)

Corey ....

Form Textbox Mulitline question
 
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....



Dave Peterson

Form Textbox Mulitline question
 
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?



"Corey ...." wrote:

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....


--

Dave Peterson

Dave Peterson

Form Textbox Mulitline question
 
ps.

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

"Corey ...." wrote:

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....


--

Dave Peterson

Corey ....

Form Textbox Mulitline question
 
Perfect!

Thanks Dave.


"Dave Peterson" wrote in message
...
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?



"Corey ...." wrote:

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....


--

Dave Peterson





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

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