Multiline text box adds the carriage return symbol (Square) to the cell?

Noki

New Member
Joined
Apr 16, 2008
Messages
48
Hi All,
In the past everyone has been very fast and helpful with my problems so thanks for that!

I have a new issue which google can't seem to answer, I have a Multi-line text box in a form which populates a merged will with its content, however it also adds the Carriage Return symbol (Square) into the cell, can anyone tell me how to fix this to stop it from being entered, or how I would go about parsing the entry of that particular symbol?

Thanks,
Chris
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Replace as I did.
Code:
Sub t()
  Dim s As String
  s = "Hello" & vbCrLf & "World!"
  Range("A1").Value = s
  Range("A2").Value = Replace(s, vbCrLf, vbLf)
End Sub
 
Upvote 0
Thanks that works great, and I can even reference the Text Fields' Name within the Replace rather then using the variable making it a one liner :D
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,280
Members
452,902
Latest member
Knuddeluff

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