Clear a Carriage Return from a String Value
Excellent!
Thank you, that works perfectly!
"Dan E" wrote in message
...
This will work on the selected range, clears the cr's lf's crlf's and
leaves nothing in their place
Sub ClearCRLF()
For Each Cell In Selection
temp = Cell.Text
For i = 1 To Len(temp)
a = Mid(temp, i, 1)
If a = vbCrLf Or a = vbCr Or a = vbLf Then
temp = Left(temp, i - 1) & Right(temp, Len(temp) - i - 1)
End If
Next
Cell.Value = temp
Next
End Sub
Dan E
"RC-" wrote in message
...
Hi All,
I have a string in a cell that has a Carriage Return in it. I'm
trying
to perform a Vertical Lookup and it's not working because of the CR.
How
can I programmatically remove the CR from the String(s)?
Any help would be great!
RC-
BTW - I already tried the Trim function that did not work.
|