56 free macros indexedAll toolsHow to runBlogGitHub ↗

How to Remove Line Breaks from Cells in Excel

How to remove Alt+Enter line breaks from Excel cells: Find and Replace with Ctrl+J, CLEAN function, and a free macro that handles all whitespace at once.

2026-04-28

The Alt+Enter aftermath problem

Someone built a "nicely formatted" column where each cell has multiple lines using Alt + Enter. Now you need to export to CSV and every line break becomes a row split. Or you need to sort and the multi-line cells confuse the sort. Or you're feeding the data into another system that wants single-line strings.

Excel can remove line breaks but the methods are quirky. Here's the spectrum.

TL;DR — Key takeaways

  • =CLEAN() removes most non-printable characters but misses some line-break variants.
  • Find and Replace with Ctrl+J in the find box catches line breaks, but Ctrl+J is invisible (the field shows nothing).
  • A free VBA macro replaces every CR, LF, and tab with a single space, then collapses runs of spaces.

Where line breaks come from

  • Alt + Enter while editing a cell inserts a literal Chr(10).
  • Web copy-paste often introduces Chr(13) or Chr(13)+Chr(10) line breaks.
  • CSV imports from systems that wrote multi-line records sometimes preserve embedded line breaks.
  • Tabs (Chr(9)) sneak in from tab-separated data.

All four cause the same downstream problems: sort confusion, CSV row-split, lookup mismatches.

Method 1: =CLEAN() formula

Excel's CLEAN() removes non-printable characters from the start of the ASCII range.

=CLEAN(A2)

The catch: CLEAN handles characters 0 through 31 in the ASCII table, which includes most line breaks. But it doesn't handle non-breaking spaces (Chr(160)), and the result is a formula, not a static value.

To wrap it cleanly:

=TRIM(CLEAN(SUBSTITUTE(A2, CHAR(160), " ")))

Now you have a 3-function nest. Workable for a one-off, fragile for repeat use.

Method 2: Find and Replace with Ctrl+J

The lesser-known trick:

  1. Press Ctrl + H to open Find and Replace.
  2. Click into the Find what box.
  3. Press Ctrl + J (Windows) or Ctrl + Option + Return (Mac). Nothing visible appears, but a line break character is now in the field.
  4. Put a space in Replace with.
  5. Click Replace All.

Repeat for any other invisible characters. This works once you know the trick.

The catch: Ctrl+J is invisible in the field. You can't tell whether you pressed it correctly. Often you have to guess based on whether Replace All says "0 replacements" or finds matches.

Method 3: The free VBA macro

Download Remove Line Breaks from Cells. Free .xlsm with one macro.

  1. Select the range.
  2. Alt + F8, pick the macro, click Run.
  3. The macro replaces CR, LF, CR+LF, and tab with single spaces, then collapses runs of spaces. Done.

In place. Plain values. No invisible-keystroke gymnastics.

A common scenario: cleaning a CRM notes export

Notes column from a CRM export has Alt+Enter breaks throughout. You need to feed the column into the analytics tool which wants single-line strings.

  1. Select the notes column.
  2. Run Remove Line Breaks from Cells.
  3. Done.

Versus the Find/Replace Ctrl+J trick: about 1 second versus 90 seconds and the cognitive load of the invisible-character trick.

Frequently asked questions

Will it remove non-breaking spaces too?

No. Non-breaking spaces (Chr(160)) are different. For those, use Trim Whitespace From All Cells which handles all four whitespace categories including non-breaking.

What about tabs inside cells?

Yes, the macro replaces tabs with single spaces along with line breaks. Then collapses runs of spaces.

Will it skip formulas?

Yes. Formula cells are skipped. Convert formulas to values first if you need to remove line breaks from formula results.

Can I keep the line breaks but replace them with a different character (like a comma)?

Edit the .bas source to change the replacement string. About a 4-line edit.

Can I undo it?

Yes, Ctrl/Cmd + Z right after running.

What to do next

After removing line breaks, common follow-ups: Trim Whitespace for non-breaking spaces, Remove Special Characters for emoji and symbols.