Good Afternoon -
I've been trying to Record and Edit a Macro to Remove ALL Line Break Characters from the Text ( NOT FORMULAS ) in a Active Cell and replace them with - ( Space DASH Space ) - Leaving the Cell Active. I want the Macro to Only apply to the Cell thats Active when the Macro is Run. ( Unless its possible to apply it to a highlighted Group of cells as well )
I read some past Treads Here and Tried Using Find and Replace - Control + J to record my starter macro but that moves me onto the next instance. I cant seem to find much information on how to contain the Code to just the Active Cell.
Manually Using Find and Replace - Control + J - Replace with - does sort of Work. It finds Some of the Line Breaks but NOT ALL. ?? I saw in the Previous Search Threads that there are other Characters that initiate Line Breaks ?
How can I tell what Character is causing the Line Breaks in my Cells ?? and incorporate them in my removal.
One Type of Text with Visible Line Breaks in Particular with imported information often has 4 to 12 Line Breaks in it that the Find and Repace routine Skips Right Over.
My Skills with VBA are Beginner -- I usually Record something and Edit it. I'm pretty good with static routines but have a hard time with variables - Constantly reading to Try to Learn.
As Always -- Any Help Appreciated !!
I am available to Post/Provide any information that I can.
Thanks for Looking
I've been trying to Record and Edit a Macro to Remove ALL Line Break Characters from the Text ( NOT FORMULAS ) in a Active Cell and replace them with - ( Space DASH Space ) - Leaving the Cell Active. I want the Macro to Only apply to the Cell thats Active when the Macro is Run. ( Unless its possible to apply it to a highlighted Group of cells as well )
I read some past Treads Here and Tried Using Find and Replace - Control + J to record my starter macro but that moves me onto the next instance. I cant seem to find much information on how to contain the Code to just the Active Cell.
Code:
Sub RemoveLineBreakAttempt7()
'
' RemoveLineBreakAttempt7 Macro
' Macro recorded 5/25/2009 by Mike
'
'
Range("B9462").Select
Cells.Find(What:="" & Chr(10) & "" & Chr(10) & "", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell.Replace What:="" & Chr(10) & "" & Chr(10) & "", Replacement:=" - ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.FindNext(After:=ActiveCell).Activate
End Sub
Manually Using Find and Replace - Control + J - Replace with - does sort of Work. It finds Some of the Line Breaks but NOT ALL. ?? I saw in the Previous Search Threads that there are other Characters that initiate Line Breaks ?
How can I tell what Character is causing the Line Breaks in my Cells ?? and incorporate them in my removal.
One Type of Text with Visible Line Breaks in Particular with imported information often has 4 to 12 Line Breaks in it that the Find and Repace routine Skips Right Over.
My Skills with VBA are Beginner -- I usually Record something and Edit it. I'm pretty good with static routines but have a hard time with variables - Constantly reading to Try to Learn.
As Always -- Any Help Appreciated !!
I am available to Post/Provide any information that I can.
Thanks for Looking