View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Remove unicode characters from cell containing values

On Saturday, March 12, 2016 at 3:16:03 PM UTC+4, Claus Busch wrote:
Hi,

Am Fri, 11 Mar 2016 20:29:06 -0800 (PST) schrieb
:

Pls assist with macro how to remove invisible unicode characters in
a cell


try:

Sub ReplaceNPC()
Dim varNPC As Variant
Dim i As Long

With WorksheetFunction
For i = 0 To 31
Range("A1") = Replace(Range("A1"), Chr(i), " ")
Next

varNPC = Array(127, 129, 141, 143, 144, 157)
For i = LBound(varNPC) To UBound(varNPC)
Range("A1") = .Trim(Replace(Range("A1"), Chr(varNPC(i)), "
")) Next
End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


55101210
55101210


Sorry to disturb but its not working on the above two numbers
If you =LEN() YOU GET 9 or 10 which is not correct as you have only 8
visible characters thxs


You need to post a link to the file so I have the actual cell contents
because I get 8 as the length.

--
Garry

Free usenet access at
http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion