Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro - Fixed text code needs replacing with variable text | Excel Discussion (Misc queries) | |||
Using Replace command for replacing a character by an ALT+ENTER | Excel Worksheet Functions | |||
replacing text in all cells with existing text plus something | Excel Discussion (Misc queries) | |||
Replacing #N/A with other text | Excel Worksheet Functions | |||
Help replacing text with Yes or No | Excel Discussion (Misc queries) |