Remove spaces after characters in Excel cells

    Code value (obtained by the CODE function) In the range 1-255, there are 148 invisible characters 1-15,28-32,127-254. Clean (A1) can be used to remove characters with code value less than or equal to 31 (including visible characters 16-27) and characters with code value equal to 128. Substitute (A1,CHAR(32),””) function can remove invisible characters whose code value is equal to 32 and 129-254, and TRIM function can remove such characters at both ends of the string. Invisible characters with code value equal to 127 can only be removed using the SUBSTITUTE(A1,CHAR(127),””) function. Using both functions together, you can basically remove all invisible characters with code values less than 255 (including visible characters with code values 16-27):
    SUBSTITUTE(SUBSTITUTE(CLEAN(A1),CHAR(32),””),CHAR(127),””)


Read More: