View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Remove unicode characters from cell containing values

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