How do I remove leading or trailing spaces of all cells in an entire column?
The worksheet's conventional Find and Replace
(aka Ctrl+H) dialog is not solving the problem.
Quite often the issue is a non-breaking space - CHAR(160)
- especially from Web text sources -that CLEAN
can't remove, so I would go a step further than this and try a formula like this which replaces any non-breaking spaces with a standard one
=TRIM(CLEAN(SUBSTITUTE(A1,CHAR(160)," ")))
Ron de Bruin has an excellent post on tips for cleaning data here
You can also remove the CHAR(160)
directly without a workaround formula by
ALT
and type 0160
using the numeric keypad