Re: Trim() does not work with Tab charachters

The VBA Replace function would be easier.

Here is an example (with your trim problem), it replaces all tabs with
spaces and the tabs before or after the string will be stripped by the Trim

Dim str As String

str = vbTab & "john" & vbTab & vbTab
Debug.Print "["; str; "]"

str = Trim(str)
Debug.Print "["; str; "]"

str = Trim(Replace(str, vbTab, " "))
Debug.Print "["; str; "]"

John... Visio MVP

"Dennis" <Dennis@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
Well, you COULD use INSTR to see if there are any Tabs, and then spin
the string and remove them.