Code:
Public Function RemoveAllSpaces(ByVal InputString As String) _ 
As String
\'NOTE: Intended for VB5 and below; if you have VB6, use built-in
\'Replace Function. (e.g., MyString = Replace(MyString, \" \", \"\")
Dim sAns As String
Dim lLen As String
Dim lCtr As Long, lCtr2 As Long
Dim sChar As String

lLen = Len(InputString)
sAns = InputString
lCtr2 = 1
For lCtr = 1 To lLen
sChar = Mid(InputString, lCtr, 1)
If sChar <> \" \" Then
Mid(sAns, lCtr2, 1) = sChar
lCtr2 = lCtr2 + 1
End If
Next
If lCtr2 > 1 Then
sAns = Left(sAns, lCtr2 - 1)
Else
sAns = \"\"
End If
RemoveAllSpaces = sAns
End Function