View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andy Kessel Andy Kessel is offline
external usenet poster
 
Posts: 5
Default Replacing alt-enter (think chr(10)) with other text

Oh never mind I found the answer. already in group. this worked great


Sub ReplaceNonPrintableCharacter()
' Use =CODE(MID(a,b,1)) to get the character
' code # of the offending character where
' a = text string
' b = character's position in string 'a'
' Ex: The above formula returns a 10 for a linefeed.
' The following replaces linefeeds with spaces.
' Replace the 10, if necessary, for your situation.


Cells.Replace _
What:=Chr(10), _
Replacement:="<br", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub