i have a list of words in list1 that all have spaces at the end. and i want to remove the spaces. But keep them in the same list box.
Thanks.
Printable View
i have a list of words in list1 that all have spaces at the end. and i want to remove the spaces. But keep them in the same list box.
Thanks.
just spaces at the end. No where else.
Use Trim when you add them to the listbox.
wouldn't trim remove the last letter no matter what it was? because not all the words do have spaces at the end.
Soemthing like that ??Code:
If Right(list1.list(i), 1) = " " Then
list1.list(i) = list1.list(i) - Right(list1.list(i)
End If
LTrim removes leading spaces, RTrim removes trailing spaces and Trim removes both.