Excel already has a TRIM worksheet function that you can use to get rid of leading, trailing, and extra spaces in between words/strings. There is a TRIM function in VBA as well (and it does exactly the same thing – remove extra spaces).