Select a cell giving the problem and run this:
Sub CheckCell()
Dim str As String
Dim lngLoop As Long
Dim strMsg As String
str = ActiveCell.Value
For lngLoop = 1 To Len(Trim(str))
If Asc(Mid(str, lngLoop, 1)) < 32 Or Asc(Mid(str, lngLoop, 1)) > 126 Then
If strMsg = vbNullString Then
strMsg = "Found:" & vbCrLf
End If
strMsg = strMsg & "ASC " & CStr(Asc(Mid(str, lngLoop, 1))) & " at position " & CStr(lngLoop)
End If
Next
If strMsg <> vbNullString Then
MsgBox strMsg, vbInformation, "Finished"
Else
MsgBox "Nothing unusual found", vbInformation
End If
End Sub
It checks for anything that is not printable text like tabs, line feeds, carriable returns, bell(!) - it will list all chars with an ASCII value < 32 or > 126
Bookmarks