Remove CODE(7) or insert CODE(10)

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,881
Office Version
  1. 2010
Platform
  1. Windows
I have a list of phone numbers that contains the non-printable character CODE(7). I can copy and paste it to Find/Replace and find it. If I click at Find Next, I can see the active cell change from one cell to the other. However, Replace All doesn't do a thing. After clicking at Replace All button several times, I then click Find Next and Excel still finds them, all in their original cells. Is there a way to remove CODE(7) without using CLEAN()? CLEAN() will do the job but it also introduces another problem.

Below is one example from the list. The two numbers are in a cell.

09-977909921
09-5120584

I could use CLEAN() to remove the non-printable characters. Unfortunately, it'd also remove the linefeed character. The above example would then become this.

09-97790992109-5120584

Now, I need to insert the linefeed character to return the string back to the original. If I replace "09-" with "ALT001009-", it will do the job but also introduce a linefeed character to the beginning of the string. The net result is not just removing CODE(7) but also adding unwanted CODE(10). If I choose this route, I now need a way to remove linefeed in the beginning of a string.

I'm looking for a way to just remove CODE(7) without adding characters. Thanks.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try this method
First replace the linefeed character with ZZZ, then CLEAN, then substitute ZZZ with linefeed character
10 is also a linefeed character

Is it characher 13 ?
=SUBSTITUTE(CLEAN(SUBSTITUTE(A1,CHAR(13),"ZZZ")),"ZZZ",CHAR(13))
or character 10 ?
=SUBSTITUTE(CLEAN(SUBSTITUTE(A1,CHAR(10),"ZZZ")),"ZZZ",CHAR(10))
 
  • Like
Reactions: yky
Upvote 0
Solution

Forum statistics

Threads
1,215,471
Messages
6,125,002
Members
449,202
Latest member
Pertotal

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