I
Ixtreme
I have an imported sheet with data. It contains various lists that I
use in a dropdown box. However, since many entries have additional
spaces at the end, the dropdown box shows the same item mutliple
times. I have tried, trim, clean but still no luck.
If I do a code() I get 32. If I look in vba I see that the 2 spaces
are displayed as 2 little squares.
I would like a piece of code that loops through all used cells per
column and then removes the additional spaces (sometimes, 2, 3 or even
4).
I found this on the net, but that does not work:
Public Function superTrim(TheString As String) As String
Dim TemP As String, DoubleSpaces As String
DoubleSpaces = Chr(32) & Chr(32)
TemP = Trim(TheString)
TemP = Replace(TemP, DoubleSpaces, Chr(32))
Do Until InStr(TemP, DoubleSpaces) = 0
TemP = Replace(TemP, DoubleSpaces, Chr(32))
Loop
superTrim = TemP
use in a dropdown box. However, since many entries have additional
spaces at the end, the dropdown box shows the same item mutliple
times. I have tried, trim, clean but still no luck.
If I do a code() I get 32. If I look in vba I see that the 2 spaces
are displayed as 2 little squares.
I would like a piece of code that loops through all used cells per
column and then removes the additional spaces (sometimes, 2, 3 or even
4).
I found this on the net, but that does not work:
Public Function superTrim(TheString As String) As String
Dim TemP As String, DoubleSpaces As String
DoubleSpaces = Chr(32) & Chr(32)
TemP = Trim(TheString)
TemP = Replace(TemP, DoubleSpaces, Chr(32))
Do Until InStr(TemP, DoubleSpaces) = 0
TemP = Replace(TemP, DoubleSpaces, Chr(32))
Loop
superTrim = TemP