Email:      Pass:    Pass?
Close Window   
Free Ebook
Get Your Free Excel
Our Top 15 Excel Tutorials
Instant Access!

Subscribe for Free Excel tips & more!

Free Excel Forum

Convert Xls To Csv With Quotes For Alpha Fields

Forum Register
Search Excel Forum Posts, Tutorials, Macros, Tips, and More

What do you use to convert an XLS file to to a CSV text file, that contains
double quotes around every alphnumeric field, but NO double quotes around
numeric fields?

Thank you.

View Answers     

Similar Excel Tutorials

Quickly Convert Formulas into Their Output Values in Excel
This tutorial teaches you how to convert a formula or function into its displayed output in Excel. This is very im ...
Convert Numbers Stored as Text to Numbers in Excel
I'll show you 4 ways to convert numbers stored as text to numbers in Excel.  This situation often happens when you ...
Make Negative Numbers Positive in Excel and Vice Versa
I will show you a few ways to change negative numbers to positive numbers and back again in Excel. Don't forget to ...
How to Add a New Line to a Message Box (MsgBox) in Excel VBA Macros
I'll show you how to create a message box popup window in Excel that contains text on multiple lines.  This allows ...

Helpful Excel Macros

Convert Numeric Dollar Values into Text in Excel - UDF
- Convert a numeric dollar amount into its text equivalent. This UDF (user defined function) for Excel will change or tra
Enter Text/Characters with a Double-Click of the Mouse
- This macro allows you to enter any text or number, that you specify, in a cell on which you double-click. In the exampl
Complete Guide to Printing in Excel Macros - PrintOut Method in Excel
- This free Excel macro illustrates all of the possible parameters and arguments that you can include in the PrintOut Meth
Filter Data Sets on Multiple Columns with Multiple Criteria at Once in Excel - AutoFilter
- This Excel macro allows you to filter a data set on multiple columns and criteria at once. This means that you can filt
Macro to add a New Line to Message Box Pop-up Windows in Excel
- This is a very simple Message Box, pop-up window, macro for Excel that illustrates how to put new lines, the same thi

Similar Topics


I have a very big import to do from Excel 2002 to a .txt file. I need
double quotes around all text fields, but I get everything but. Can
someone pleeeese tell me how to do this.

Do I need the format of the fields to be general or text? Do I start
with single quotes, double quotes, no quotes or maybe even two single
quotes? I've tried everything I can think of.

I even tried going through a .csv file, but then I get three double

Thanks a bunch,


I have data in an excel worksheet. I have to save it as a .CSV file (comma separated values) to supply the data in ASCII format. A requirement is that alphanumeric fields must be displayed in "double quotes" and numeric not. Excel automatically will put double quotes (when you open the CSV file, say, in Wordpad) only around a text string containing a comma. I have several fields/cells which must be alphanumeric but obviously do not have commas in the text. How do I get the text cell to either (1) display with double quotes in excel (without having to phyically type them into each cell - there are thousands!) or to display with double quotes when opening the file as a CSV or text file.

I am trying to open a text CSV file in Excel to edit the file, but require
certain fields to have double quotes around them. When I do this, I get the
message about not all features are supported and when I then look at the
file, the double quotes are gone. Is there a way to keep the double quotes
when making the changes and then saving the file as CSV.

Hi - I'm having an issue when importing a csv file into Access. The field delimiter is obviously a comma, and the text qualifier is double quotations.

I'm getting a parsing error when trying to import when double quotations are found WITHIN the text field. For example:

1, "Steele, George", "George "The Animal" Steele"

The first 2 fields are fine, but the third field - with "The Animal" contained within the text, causes the problem. I'd simply like to change the double quotations surrounding "The Animal" to single quotes.

The file I am using is HUGE - about 750mb - and this will take place daily. Thus, performance is an issue as well.

I've been playing with the Replace function and am using VBA - still struggling with the logic, however.

Any assistance or direction would be greatly appreciated.


I need to be able to save a spreadsheet as a csv file, using comma delimited
but also having double quotes around each field. I'm running Excel 2000, on
Windows XP sp2. Any help would be appreciated.

I am having dificulty finding a way of saving a file in the format I need
for another application.
I have a file which has a number of fields enclosed in quotes and seperated
by commas. Some of these fields are text and some numeric though treated as
text, eg phone numbers. I can open the file with Excel, make changes I need
to but when it comes to saving I cannot figure out how to get the same
format again. It has to be comma seperated with each field in quotes and
carriage return at the end of a record.

Thanks for any help.


I had to have all my Excel 2010 file moved from a destop to a portable and now when I try to put the double quotes into formulas they do not come as " but rather as single quotes but not until I press the double quote and then they only show up as single quotes. Can somebody explain why the double quotes are gone as they are rather important to writing formulas.

When I create csv files, I need to have all columns wrapped in double-quotes. Currently, Excel only wraps those columns that contain commas in double-quotes. I have access to both Excel 2003 and 2007. Is there a way to configure Excel to wrap all columns and if not, is there some VB magic that I can run to do this?

I tried to search the forum to see if this had already been discussed, but did not find anything.



I am trying to code the following statement into an excel VBA program.
I am having problems because I have two sets of " quotes. I not sure how get around the 2nd double quotes. I tried single quotes around this, but still experiencing an issue. Any help is appreciated. Thanks for your time in advance.

Range("p3").Formula = " =IF(I3= " #N/A Field Not Applicable " ,0,I3) "

hello, i have a table that contain text and memo fields with double quotes. for example, royal "BP" petro station. I would like to find a way to get rid of the double quotes by using a query or another method. i do not wish to use the find and replace method because i have a million records, with at least 10 fields. i tried using the Replace() function, but I can't seem to get it to work. If there is a way to make the Replace() function work, make another function work, or there is VB available, please help me get rid of the double quotes. thanks in advance.


I'm using an IF function that replaces [square brackets] with "double quotes" (it has to be double quotes)

How do I specify that the double quote character is inserted as a piece of text without Excel seeing the quotes as a command to end the string of text to be replaced?

Hi there guys
If I have a xpreadsheet how can I save as a csv file with each column enclosed in quotes?? I can save the file as a csv but the fields are not enclosed in double quotes like below.


I am using a spreadsheet in Excel 2003 and trying to write some code to lookup and return a value from a closed csv file.

The csv file is comma delimited and each field is enclosed within double quotes eg "Jim". Unless I add double quotes to my Excel cell content (currently Jim) I get a failure. I cannot sensibly remove the double quotes from the csv file and it contains nearly 200,000 lines of data so also cannot convert it to Excel2003 format. (We haven't upgraded yet!).

I've tried Extended Properties of text and IMEX=1 to no avail. I've also tried importing the csv to Access and looking up that table from the Excel file, but get the same problem. I've tried formatting the Excel cell to be text before adding the data - no change...

I might be missing something simple, but cannot find any clues about this, even using Google!

Can anyone help please?

The current code (which works as long as Cell(i, 11) contains "sampledata") is:

Set cn = CreateObject("adodb.connection")
Set rs = CreateObject("adodb.recordset")

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data source = FolderPath;" & "Extended Properties=""hdr=yes; IMEX=1"""
rs.Open "SELECT donor_id FROM master_lookup.csv WHERE Zip = " & (Cells(i, 11).Value), cn, 3, 3
Cells(i, 47).CopyFromRecordset rs

Obviously one workaround would be to add double quotes to each of the Excel file cells, but even that seems prone to problems - is it even possible within VBA?


I'm exporting a tab delimited file, but I notice that Excel wraps quotes around fields that have a comma, and fields that have quotes.

Is there a way to prevent this and just get the raw data. The reason I'm using a tab delim file is because I want the commas in the fields, but it's much easier to import into my DB if I can prevent this "" wrapping, and just get a raw tab delim file.

I searched the boards but i could not find an answer to what I am sure is a simple solution to a vexing problem. When I save my execl sheet into a text format then open it in notepad or wordpad it puts quotes around the data.

I am using the data to insert into Oracle databases and therefore the double quotes must be taken out. In the notepad/wordpad I can do a find and replace but it can be time consuming when you have a large number of rows. Does anyone know how to get rid of the quotes?


I'm trying to use the Concatenate function to put double quotes around the value in an adjacent cell...however I know you can't embed double quotes inside of double quotes.

Is there way to get this done using the concatenate function. or is there another function that I can use to put double quotes around a value?

I need to create a csv text file with the fields acutally delimited by commas and with quotes around each field. I am starting from an excel file and saving the file as a csv. But this approach leaves me with out the quotes.

So if I start with this in an excel csv
M Blended_Mix P P S FKINX S 30 28 32

And even though I saved this as a csv, it seems like it is really a tab delimited file. So that if I simply copies and pasted the above into a text file, the fields are separated with a tab.

What I need, though I need to end with this in a text file.

"M","Blended_Mix"," ","P","P"

I am using Excel 2010.

Hi All,

Looking to do something very simple.

I need to export some data to STATA, but for the program I wrote to work, the dates need to be surrounded by double quotes. I just need to copy and paste a long list of dates, each surrounded by double quotes, into my do.file

any ideas on how to put quotes around the dates already entered into the excel cells?

Thanks for any ideas!!


if 9/04/2011, afterwards it would be "9/04/2011"

Does anyone know how to export data from an .xls file to a csv, and encode
all text fields with double quotes > ""?
I can use "save as" to get a csv file, but then the text does not have
double quotes.
any ideas?

Here is what I want to do. From the internet I download some data that
are in csv format. All data will be in one long string. Now I need to
extract every cell. The problem ist that some cell content contains
commas and/or double quotes. Some of the cell contents that contain
double quotes use double double quotes and others don't, i.e. some look

"this "item" is bad", "this item is ok"

and others like

"this ""item"" is bad", "this item is ok"

There is also a chance that some cell are in double quotes (if they
contains commas or double quotes) and others are not in double quotes
(if they do not contain commas or double quotes). Considering all this
(and possibly more stuff) parsing becomes non trivial.

As a first approach I stored the content downloaded into a file and
then use odbc like this:

connectionString = @"Driver={Microsoft Text Driver (*.txt;
*.csv)};DBQ=" + Path.GetDirectoryName(filename);
connection = new OdbcConnection(connectionString);
command = new OdbcCommand("Select * FROM " +
Path.GetFileName(filename), connection);
reader = command.ExecuteReader();

Unfortunately, this approach does not work for the above scenarios.
Excel reads the files in question just fine, though. So my question is
what is the best approach to read csv files, preferably without having
to create temporary files?


We are using Excel 2003. When we export a spreadsheet as a text file, using
the "File/Save as" menu item, we don't get quotes around the fields.

Unfortunately, we need them, because our mass mailer won't accept the data
unless the quotes are present.

Where did they go? How do I get them back? TIA, all.


I have the following code:

Sub test()

Cells(1, 1) = "hello" & Chr(10) & "world"

End Sub

It produces exactly what I want it to produce... However, if I go to cell A1 in my sheet, copy it, then paste it into a text editor (Word pad), I get the following:


I'm getting the double quotes before and after the text. The quotes do not appear in my excel cell. They only appear after I paste into the text editor...

Does anybody know how to prevent this from happening?


p.s. I'm actually saving the excel file into a text file via VB:

DestWkbk.SaveAs Filename:= _
"C:\temp\hello.pos", FileFormat:=xlText, CreateBackup:=False

And I still see the double quotes.

I'm trying to paste text that contains double quotes into Excel.


"Bob Anderson" 36475tmmn8766

Excel is stripping out the double-quotes upon pasting. I've look
everywhere for an option or setting to override this but have been

Does anyone have any ideas?


- Bob A.

Is it possible to save an Excel file as .CSV format, yet retain a single set of double quotes around a field, without editing in some other program down the line? Every attempted I've made yielded a "triple double" result.


I have an annoying problem! I get several extra double quotes when there is a double quote in my text.

Here is an example:

The original text:

After I have saved the file to txt or csv I get this text:

I can't see the extra double quotes in Excel but I get problems when I use the file in the next step. I can see them it I open the file in a text editor.

Is there any setting or way to avoide this??