Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Excel 2007 - How to export a sheet to tab delimited text file without doublequotes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
qu4dman - 09 Jul 2007 12:23 GMT
Hello all,

I have a little problem to resolve. I have worked on an Excel 2007
sheet and am trying to export it to a tab delimited text file (Save
As...) but when the file is exported, and when I open it with a text
editor such as Notepad then I view a lot of doublequotes added to some
values... Do you have a clue about that ? I'd like to get a text file
that has nothing added to it when exporting it...

Thanks
Dave Peterson - 09 Jul 2007 12:57 GMT
Excel does what it thinks is right.

You could use a macro and write code and have complete control over what you
write.

Here are three sites that you could steal some code from:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly:  http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html

Earl's program may work right out of the box.

> Hello all,
>
[quoted text clipped - 6 lines]
>
> Thanks

Signature

Dave Peterson

qu4dman - 11 Jul 2007 07:15 GMT
> Excel does what it thinks is right.
>
[quoted text clipped - 26 lines]
>
> Dave Peterson

I did not say that Excel does a bad job :) Hehe.
I found a macro and that does what I need. I thought of programming
such a macro but as there are many one out there, I use them :)

Thank you :)
qu4dman - 11 Jul 2007 07:19 GMT
> Excel does what it thinks is right.
>
[quoted text clipped - 26 lines]
>
> Dave Peterson

Just in case this could help others in the same case and that would
get on this thread, the VBA macro I use is the following one, that can
be found on the URL
http://www.developerfood.com/comma-delimited-export/microsoft-public-excel/366c6
ba2-336b-4e8f-bc06-5298ee062614/article.aspx


I Public Sub TextNoModification()
   Const DELIMITER As String = vbTab
   Dim myRecord As Range
   Dim myField As Range
   Dim nFileNum As Long
   Dim sOut As String

   nFileNum = FreeFile
   Open "D:\outputfiles\datafile1.txt" For Output As #nFileNum
   For Each myRecord In Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
       With myRecord
           For Each myField In Range(.Cells(1), _
                   Cells(.Row, Columns.Count).End(xlToLeft))
               sOut = sOut & DELIMITER & myField.Text
           Next myField
           Print #nFileNum, Mid(sOut, 2)
           sOut = Empty
       End With
   Next myRecord
   Close #nFileNum
End Sub
Dave Peterson - 11 Jul 2007 11:42 GMT
This is JE McGimpsey's code just posted (without attribution) somewhere else.

And by the way, you may have wanted to try Earl Kioserud's workbook.  It offers
options and may require less knowledge of VBA than the others.

> > Excel does what it thinks is right.
> >
[quoted text clipped - 54 lines]
>     Close #nFileNum
> End Sub

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.