Folgender VBA-Code ersetzt in allen Zellen des aktiven Tabellenblattes Zeilenumbrüche mit einem Leerschlägen:
Gruss
S. Widmer
Sub ZeilenunbrücheEntfernen()
For rwIndex = 1 To Cells.SpecialCells(xlLastCell).Row
For colIndex = 1 To Cells.SpecialCells(xlLastCell).Column
With Cells(rwIndex, colIndex)
ofs = InStr(.Value, Chr(10))
While ofs > 0
.Value = Left(.Value, ofs - 1) & " " & Right(.Value, Len(.Value) - ofs)
ofs = InStr(.Value, Chr(10))
Wend
End With
Next colIndex
Next rwIndex
End Sub
Sub ZeilenunbrücheEntfernen()
MaxRows = Cells.SpecialCells(xlLastCell).Row
MaxCols = Cells.SpecialCells(xlLastCell).Column
For rwIndex = 1 To MaxRows
For colIndex = 1 To MaxCols
With Cells(rwIndex, colIndex)
ofs = InStr(.Value, Chr(10))
While ofs > 0
.Value = Left(.Value, ofs - 1) & " " & Right(.Value, Len(.Value) - ofs)
ofs = InStr(.Value, Chr(10))
Wend
End With
Next colIndex
Next rwIndex
End Sub