remove carridge return / line feed symbol ??

blueroost

New Member
Joined
Jul 15, 2010
Messages
44
when i type into text box on user form (use enter for multi line) i get symbol at the end where i hit enter (think it may be carridge return or line feed, not too sure)

Example typed into text box

mr jones
53 albert street
axas 234

Returned Value in cell is

mr jones ||

53 albert street||

axas 234||

or something to that effect

how to i remove these symbols?????

help please
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
You would put the formula in a cell, assuming that the cell with the text is A1.

Now I've thought about this some more and tried it myself I'm not sure what the problem is. Where do you see these extra characters? I've tried typing text with carriage returns into a text box on a form and then set a cell value to the text in the box and there are no extra characters.
 
Upvote 0
It looks like you're using vba to capture something typed and save it into a text file, as that's the only time i've had carriage return/line feed problems. Using the formula given earlier in a worksheet would work fine at returning the information without the linefeed/carriage return within another cell of the worksheet, but if you're using vba to write values to a text document or interpret what you put on a form and put it into a cell, you need to edit your vba to strip out those lf/cr's and writeline will add the appropriate symbol to the end of the line without a visible symbol appearing.
 
Upvote 0
using

NameInput = Form.inputbox
cells("A1").value = NameInput

would need to be changed to

NameInput = Form.inputbox
NameInput = Replace(NameInput, chr(13), "")
NameInput = Replace(NameInput, chr(10), "")
cells("A1").value = NameInput



If you could paste the form code for us we could probably be more accurate at what you need done.
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,923
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top