Link to home
Create AccountLog in
Avatar of Rrave26

asked on

VBA Question

I got help in getting a data cleaning script written to help remove unwanted spaces and characters in my source data.  It works pretty well but I have noticed that it has missed catching some blank spaces. Any idea on why?
Avatar of Simon
Flag of United Kingdom of Great Britain and Northern Ireland image

They might be 'non-breaking spaces'. Just taking a look now at your sample file.
Please identify an example cell that has the problem.

To remove non-breaking spaces you could modify the "=TRIM" line in your CleanData macro
WS.Range("ZZ1:ZZ" & MaxRow).Formula = "=TRIM(SUBSTITUTE(" & Left(rCol.Address, InStr(1, rCol.Address, ":") - 1) & "1,CHAR(160),CHAR(32)))"

Open in new window

Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Rrave26


I will try that today Martin, and get back to you with the results.
Avatar of Rrave26


I agree. Martin.  Thanks for the help.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.