Finding and Replacing Line Breaks?

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Datsmart

Well-known Member
Joined
Jun 19, 2003
Messages
7,985
Ste_Moore01


Not sure about "Line Breaks", but if it is Page Breaks you want to replace...

This will reset all page breaks:

Sub ResetPageBreaks()
ActiveSheet.Cells.PageBreak = xlPageBreakNone
End Sub

John
 

Ste_Moore01

Active Member
Joined
Jul 13, 2005
Messages
467
No I meant line breaks as in you press Alt+Enter when typing in a cell and it goes onto the next line.

I've manually changed them now, but I'm still curios as to whether this is possible or not.
 

Datsmart

Well-known Member
Joined
Jun 19, 2003
Messages
7,985
This worked for me on a single sheet.

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

Watch MrExcel Video

Forum statistics

Threads
1,119,272
Messages
5,577,133
Members
412,769
Latest member
VK12345
Top