extra quotation marks when excel ws is saved as txt file

C

Casey Streuber

I am trying to automate a process that creates a txt file
needed for an application. However, this text files needs
a set of double quotations, and also has some cells that
will have commas. When I save the excel worksheet that
contains this information, the text file ends up with
this """abcd""" instead of the original "abcd". Any cell
with commas is found in the text file with double quotes
surrounding it as well. Is there anyway to save the excel
worksheet as a text file and receive exactly what is
entered into the cells?

Note: I am able to copy and paste the information into a
text file and get what I am looking for, but in order to
automate this process I am using a macro. I don't know of
anyway to copy excel data and paste it into a text file
through a macro. Any ideas would be appreciated.
 
D

Dave Peterson

The reason you got """abcd""" was that excel saw the existing double quotes in
the cell. You may want to test your receiving program to see which format it
likes better. (You might not have anything to do!)

But if you want more control over the output data, you could try Earl
Kiosterud's Text Write program. It's available at:
http://www.tushar-mehta.com/
(Look for Text Write in the left hand frame.)

Earl has a bunch of options that you can specify.

And you may want to look at Chip Pearson's code:
http://www.cpearson.com/excel/imptext.htm
(if you want to write your own and have complete control)
 

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

Top