Removing Special Characters

C

Cathy Landry

Hello,

I exported to Excel 2003 my Outlook Calendar and now I have a lot of odd
little square characters that I cannot remove. Any suggestions please?

Thank you!
Cathy
 
J

Joe User

Cathy Landry said:
I exported to Excel 2003 my Outlook Calendar
and now I have a lot of odd little square characters
that I cannot remove. Any suggestions please?

Refer to http://office.microsoft.com/en-us/excel/HP030561311033.aspx.

Basically, you can use CLEAN to remove nonprinting characters with ASCII
codes 0-31.

But I suspect the nonprinting characters you are seeing (hmm, an oxymoron?
;->) in the ASCII code range 127-255. You would need to use several
SUBSTITUTE calls to remove each one. It would be better to use a macro. I
believe someone has one; but I didn't find any with a quick Google search.
Or it might be sufficient to replace CODE(160) with a space (" ").

However, beware: some of those values might be printable characters in some
character set. You might want to save a backup copy of the Excel file before
making any changes.
 
C

Cathy Landry

Hi Joe,

Thank you for the response! I found a public function to use that's working
great!

Public Function fStripToLtrNum(strIn)
'Strips out all non-number or non-letter characters
Dim strOut As String
Dim iPos As Long

If Len(strIn & "") > 0 Then
For iPos = 1 To Len(strIn)
If Mid(strIn, iPos, 1) Like "[0-9A-z]" Then
strOut = strOut & Mid(strIn, iPos, 1)
End If
Next iPos
End If

If Len(strOut) = 0 Then
fStripToLtrNum = Null
Else
fStripToLtrNum = strOut
End If
End Function
 
D

digileaf

The clean function in Excel sorts this out perfectly.

Lets say your string with these funny characters is in cell A5, then i
the adjacent cell type =CLEAN(A5) and you'll get the string without th
funny characters in there.

It's brilliant and so simple.

Kate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top