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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Tab-Delimited text file 1

Status
Not open for further replies.

rockfish12

Technical User
Feb 12, 2002
31
US
I am trying to create a tab-delimited text file using VBA, a snippet of which is shown below. When I run the procedure, the coords.txt text file is created with what appears to be a tabs separating the values, but as it turns out, they're not. Or at least other programs don't recognize it as a tab-delimited file...for instance, Excel doesn't recognize it as such when you try to import it as text.

What is the best way to create a REAL tab-delimited file? Any help would be much appreciated.

-----------------------------------------------------------
Open strDirPath & "\coords.txt" For Append As #1
Print #1, nEastMin; Tab; nNorthMax; Tab; nEastMax; Tab; nNorthMin
Close #1
-----------------------------------------------------------
 
Try using "vbTab" instead of the "Tab" function.
vbTab is a member of the Constants collection, so if you like to fully qualify your code, use "Constants.vbTab" in place of the "Tab" function.

It worked for me when I tried it.

Hope this helps,
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top