SaveAs *.txt - Outputting with Text quantifiers




I am trying to export a worksheet as a *.txt file but do not want the text
quantifiers to appear (ie. the quotations around the text columns).

Here is a snippet of my saveas code:
ActiveWorkbook.SaveAs Filename:=mylocation , _
FileFormat:=xlText, CreateBackup:=False

Do I either have to change the format of the columns before I use the SaveAs
or can I mod the SaveAs function (ie. use a different paramter or try
different FileFormat's.)


Dave Peterson

Maybe you could save the file as a .PRN file.

Or maybe you could use a macro and do exactly what you want:

On the other hand, if the data contains those double quotes, I'd use a macro:

(saved from a previous post)

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

Earl Kiosterud's Text Write program:
(or directly:

Chip Pearson's:

J.E. McGimpsey's:

(or maybe you could build your own formula and copy|paste into Notepad.)

Check out Earl's Text Write program first. It may do exactly what you want
right out of the box.

Another way is to use a helper column and concatenate each of the fields the way
you want:

(where | isn't used in your data)

then drag down.

Then copy that column and paste into NotePad and save from there.


If you want the data all in one line then you need to alter the file
before saving out to a *.txt file - The output depends on what the data
The xlTextPrinter will just stop the quotations around text.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question