Customising Export From XLS to CSV

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I go about adding Double quotes around each field in excel?
At the moment it is exporting data like this
Title,Name,Surname,etc

I would like it to export like this
"Title","Name","Surname","etc

Thanks
 
Select the desired cells and run this macro:

Sub AddQuotes()
Dim cell As Range
For Each cell In Selection
With cell
.Value = Chr(148) & .Value & Chr(148)
End With
Next
End Sub
 
Hi Jason,

Thanks for the reply
The macro doesnt take into account that the cell might have a comma in it.
If the export function in excel detects a comma it automatically adds the
Double quotes.
So I would end up with two sets of double quotes. Any idea on how to stop
this?

Excel used to be able to export as I wanted automatically, is there any way
of getting to export as required without the macro?

Thanks
don
 
Back
Top