ALT + ENTER creates a character called vbLF (for visual base channel). You just want to replace vbLF with a space, for example:
Sub test() Dim str As String str = Range("A1") Debug.Print str str = Replace(str, vbLf, " ") Debug.Print str End Sub
Put it in a loop:
Sub test() dim i as integer Dim str As String for i = 1 to 10 '(however many you want, can also be dynamic - use XlUp if you want to) str = Range("A" & i) Debug.Print str str = Replace(str, vbLf, " ") Debug.Print str next End Sub
source share