I suggest it would be easier to select the entire worksheet and use Replace (Ctrl+H) to replace every non-break space (NBSP) with a space. This still leaves spaces at the end of cells but avoid removing NBSPs from the middle of cells. You still need Trim but that is easier than TRIM(SUBSTITUTE(...)).
I thought I would be able to enter a NBSP using Alt+160 but it did not work for me. I had to use Insert Symbol to place a NBSP into a cell, copy it out of there and drop it into the Find what field.
With Insert Symbol, NBSP is the empty cell on the third line under 4.
If this is a repeating problem, you could use the macro recorder to save the Replace. However, it might be better to write a macro which uses FIND to locate NBSP anywhere within any string and either replace it with space or delete it according to its position within the string. This macro would need to loop until FIND fails.