Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Replacing alt-enter (think chr(10)) with other text

I'm a little out of practice and need some help.

I need a macro to replace chr(10) -( the result of using alt-enter when
editing a cell) in value cells with a string "xxxx" or whatever.

I know this is basically easy, but could use some help. I'm not sure
if I would have to navigate through all cells, and look one character
at a time and when I find this to replace it, or if there is another
way.

Certainly can't figure out how to do it with find and replace.

Thanks,

Andy Kessel

  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro - Fixed text code needs replacing with variable text steven.holloway Excel Discussion (Misc queries) 3 July 22nd 08 03:57 PM
Using Replace command for replacing a character by an ALT+ENTER Peter from Novartis Excel Worksheet Functions 4 June 16th 06 02:57 PM
replacing text in all cells with existing text plus something avi2001 Excel Discussion (Misc queries) 2 November 2nd 05 04:29 PM
Replacing #N/A with other text Dave Excel Worksheet Functions 2 August 11th 05 11:27 PM
Help replacing text with Yes or No Jerry Arnone, PMP Excel Discussion (Misc queries) 6 June 24th 05 02:05 AM


All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"