Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Remove double quotes from text file

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Remove double quotes from text file

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

"Dave L" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Double quotes when exporting to tab delimited file jjk98 Excel Discussion (Misc queries) 2 January 13th 10 01:53 PM
Double quotes bracketing text strings that include commas ExcelStudent Excel Discussion (Misc queries) 1 August 2nd 07 12:48 PM
CSV File with double quotes NavSysEng Excel Programming 2 April 4th 06 05:18 PM
copy/paste excel to texteditor -> multi-line text cells gain unwanted double-quotes niz Excel Discussion (Misc queries) 1 October 14th 05 02:06 PM
how to remove double quotes? Robert Kim Excel Programming 4 September 28th 04 09:28 PM


All times are GMT +1. The time now is 02:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"