VBA code to remove white spaces from a string in excel

VBA code to remove white spaces from a string in excel. Simple method is, use Replace() function.

Example:

Output:

remove-white-spaces-VBA-macro