Removing [] (little square) from Excel Files
Here is a VBA macro that will remove all the newline characters from an Excel file. They look like little squares [] or they add an Enter to a cell. I suggest saving this macro in your PERSONAL.xls file so it is available in all your Excel files. Then just run the macro and it will fix your file. This often happens when transfering data from Unix based systems to Windows based systems. The newline character is sometimes refered by ‘\n‘ or ‘\r‘ or even ‘\n\r‘. The trick is Excel refers to it by ‘vbNewLine‘, thats why your Find & Replace doesn’t work.
Sub RemoveNL()
'
' RemoveNL Macro shared by FrankBaris.com
'
s = vbNewLine
r = " "
Cells.Replace What:=s, Replacement:=r
'
End Sub
Hope this comes in handy!
Ow i so wanted this to be the answer but it did not work for me, Can you help?
I have exported from Outlook a set of emails. I have created a CSV / or even an exl doc and open it. I have lots of these little square characters in the body text which is repeated in all cells which contain text. In order for me to sort the cell i need to remove them and i hoped your Macro would do it but it didn’t?
They appear to be line returns??
Please help
Got it to work, I had removed spaces which stopped the Macro.
Thanks