Removing Carriage Return Symbols

week18

New Member
Joined
Apr 28, 2002
Messages
1
When importing text that was created in a DOS-based data collection package, small rectangular boxes appear where the carriage return was struck during the original data capture. I've tried copying the small boxes to the clipboard to remove them globally, but they do not copy to the clipboard. Any suggestions how they can be removed? Thank you.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hiya,

For some odd reason this seems to work more or less consistently:

Select the column and go to DataText to ColumnsFinish - no more boxes. If that fails, you might want to try a TAB delimiter - but usually this works (for me anyway) w/o one.

Adam
 
Upvote 0
Hi,

Try,

Sub ReplaceCR()
Cells.Replace What:=Chr(10), Replacement:=""
End Sub

I think there are other codes which equal carriage returns, but I don't know them off hand.

Bye,
Jay
 
Upvote 0
you can also clean those cells using =CLEAN

so =CLEAN(A1) and copy down.... from the help file it says "Removes all nonprintable characters from text. Use CLEAN on text imported from other applications that contains characters that may not print with your operating system. For example, you can use CLEAN to remove some low-level computer code that is frequently at the beginning and end of data files and cannot be printed."

it doesn't, however, clean character # 127, whatever that is. So substitute it first...

=CLEAN(SUBSTITUTE(A1,CHAR(127),""))
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,797
Members
449,048
Latest member
greyangel23

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