Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get a tab character 3

Status
Not open for further replies.

GBall

Programmer
May 23, 2001
193
GB
Hi,
I'm trying to output a tab separeted piece of data like so.

Dim strSeparator As String

strSeparator = Chr$(9)
strCSV = strCSV & """" & Me(i).Value & """" & strSeparator

but all I'm getting is 4 spaces and a carriage control, linefeed.
Even if I do ?chr(9) in the debug window I get the same.
Anyone know why this should be ?


Regards,
Graham
 
Got your file and tried the following trick:
At the end of your procedure, I placed the following code:

Open "C:\Test.txt" For Output As #1
Print #1, strCSV_Text
Close #1

After running it, I got a txt file with perfect tabs - moving through the file with the arrow just jumped from piece to piece. Opening it with Word showed the tabs allright. Importing from the file was perfectly successful.

But a Debug.Print just returned spaces instead of tabs. I think you shouldn't be worried if you use file I/O. And I guess the Debug.Print just converts the tabs to the corresponding number of spaces (default 4, changeable from Tools - Options).

Good to know... [smile]


HTH



[pipe]
Daniel Vlas
Systems Consultant

 
Thanks Dan, didn't think of trying that.
Works as advertised.
Thanks again.

Regards,
Graham
 
That's true.
I didn't read it properly and realise the significance, as I was chasing the update between other jobs here.
I've marked his post as helpful as well.
Thanks guys.

Regards,
Graham
 
You guys are just too kind...

[2thumbsup]

There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top