Saved from a previous post (I'd use the macro at the end):
Saved from a previous post.
You may want to try a macro from David McRitchie. Depending on what's in the
cell, it may work for you.
http://www.mvps.org/dmcritchie/excel/join.htm#trimall
(look for "Sub Trimall()"
If that doesn't work...
Chip Pearson has a very nice addin that will help determine what that
character(s) is:
http://www.cpearson.com/excel/CellView.htm
Then you can either fix it via a helper cell or a macro:
=substitute(a1,char(##),"")
or
=substitute(a1,char(##)," ")
Replace ## with the ASCII value you see in Chip's addin.
Or you could use a macro (after using Chip's CellView addin):
Option Explicit
Sub cleanEmUp()
Dim myBadChars As Variant
Dim myGoodChars As Variant
Dim iCtr As Long
myBadChars = Array(Chr(##), Chr(##)) '<--What showed up in CellView?
myGoodChars = Array(" ","") '<--what's the new character, "" for nothing?
If UBound(myGoodChars) <> UBound(myBadChars) Then
MsgBox "Design error!"
Exit Sub
End If
For iCtr = LBound(myBadChars) To UBound(myBadChars)
ActiveSheet.Cells.Replace What:=myBadChars(iCtr), _
Replacement:=myGoodChars(iCtr), _
LookAt:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=False
Next iCtr
End Sub
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Dave,
I'm getting back to the delimitor problem this morning. That Excel macro
was great: it found that it was not, in fact CONTROL-ENTER that was the
invisible characters but dec 013 and dec 010. Now how can I remove these
special characters and replace them with (for example) spaces?
BTW, I put in a few test CONTROL-ENTERs in a spreadsheet, and I tried FIND
CONTROL-J and it still couldn't find them. Could you be a bit more explicit
about what you want entered into the FIND/REPLACE box? (I know this is a bit
thick-headed, but the devil is in the details.)
PhillyRon