remove CR, CR.LF?

guthrie

New Member
Joined
Jun 14, 2007
Messages
31
I have a bunch of data copied from an excel export in ACT, and for some reason this time many fields show up as two lines, the data and then a blank line (in the edit bar).
I can put the cursor on the second blank line and backspace, and then it shows up properly, and all is well.
I can also tell something is there, as formatting shows it as two lines, and also len() shows one too many characters present.

I have seen many articles on how to replace LF using Ctrl-J, but that doesn't match anything. And trying to enter Ctrl-J in the Find box, shoes not show anything. (Should show a dot?).

However doing a "=SUBSTITUTE(F5,CHAR(10),"")" does seem to work, but would be a lot of trouble to do for all columns of data to change and then copy over original data.
Some places indicate that a CR/LF is different, but I don't know how to deal with that.

Is there some way to actually see what the hidden formatting characters are in the cell(s)?, and then to Find/replace to truncate?

ee.jpg
 

Attachments

  • ee.jpg
    ee.jpg
    26 KB · Views: 3

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I also note that copying some cells into Word, I see some odd square character at the start f the line(?)

And using "clean()" will also fix things, but would require a lot of copy and overlay of everything, and in any case I'd like to know what is going on.

e2.jpg
.
 
Upvote 0
Try this macro
VBA Code:
Sub RemoveCR()
ActiveSheet.UsedRange = Evaluate("Substitute(" & ActiveSheet.UsedRange.Address & ",char(10),"""")")
ActiveSheet.UsedRange.WrapText = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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