As an after thought

The TRIM() formula in Excel will remove leading, trailing and any extra spaces

The Trim() formula in VBa only removes leading & trailing spaces

This might be worth watching if you use VBa to correct column D
There might be mismatches where accidental spaces have been added at source.

Cheers
Alistair