Finding and replacing the tab character


Posted by Carl on March 07, 2001 4:28 PM

If one imports a text file with tabs into excel the tab characters will appear as squares, unless the text file is imported and the tabs are used to delineate columns. Given that I do not want use tabs as a column delineator how do I find and replace these squares with spaces. A simple find and replace using ^t or \t does not work. Thanks.



Posted by Rob on March 08, 2001 4:55 AM

Carl,

try this macro on your imported text files:

Sub TabRemoval()

Columns("A:A").Replace _
What:=Chr(9), Replacement:=" "

End Sub