Remove double quotes from text file

  • Thread starter Thread starter Dave L
  • Start date Start date
D

Dave L

I have a macro that saves a csv file with only one cell with a value. The
cell contains commas though so it saves it in the text file with quote around
it. Ex:

Cell contents:
,value,value,value,,,

When the text file is open in notepad:
",value,value,value,,,"

Is there any way to get rid of the quotes and have it read exactly like it
does when open in Excel?
 
Have your macro save it as a .prn file instead of .csv. In the Save As dialog
this is called Formatted text (space delimited)(*.prn). The code may look
like this:

ActiveWorkbook.SaveAs Filename:= _
"D:\Data\Book1.prn", FileFormat:= _
xlTextPrinter, CreateBackup:=False

Then, if desired, you can change the extension on the file after you close it.

Hope this helps,

Hutch
 
Back
Top