LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Save .txt file to .csv in VBA

Hi List,

User has 4 CSV format files. Since there are extra spaces in the files
when open them from Excel, they have to open each of them using NotePad
and delete the extra spaces. They can't do this from CSV file directly.
If they deleted the extra empty column from Excel, and open it again
with NotePad, the " " will disappear.

They want these steps can be handle using a macro, so they don't need
to manually open each file and delete the spaces.

What I did:

I open csv file as input, use trim(string) to get rid of the extra
spaces. then i write each row to a .txt file.

if i open the txt file using NotePad then do SaveAs to a csv file. it
works fine. when user reviewing it from NotePad, they still see " "
around each field. But my question is, how can I accomplish this step
using VBA?

I tried to open the txt file from Excel and save it as .csv file, when
i open the .csv file from NotePad, all the quotes were gone.

I have posted my questions for a couple of days, but didn't get any
answers so far. Please, if anyone has any idea, please let me know.

Thanks so much.

 
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
Excell2003 (SP-1) File > Save and File > Save As.. grayed out Joe Murphy Excel Discussion (Misc queries) 0 March 9th 05 10:00 PM
Save Excel file - prompts to save - no Volitile functions used POWER CERTS Excel Worksheet Functions 2 November 1st 04 09:27 PM
Excel marcos firing on file save as but not file save Andy Excel Programming 1 August 3rd 04 10:34 AM
Save File to Another Directory, but not change Users File Save location Mike Knight Excel Programming 1 May 28th 04 09:06 PM
Save As - Multiple Sheets fails to save as text file Ravee Srinivasan Excel Programming 2 November 10th 03 04:05 PM


All times are GMT +1. The time now is 01:37 PM.

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"