+ Reply to Thread
Results 1 to 8 of 8

Macro to save file as CSV (Comma Delimited)

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Macro to save file as CSV (Comma Delimited)

    There's three types of CSV files: CSV (Macintosh), CSV (MS-DOS), and CSV (Comma delimited).

    I have a macro to autosave my file and I need CSV (Comma Delimited). When I look at the files I save correctly they just say .csv at the end, but this isn't saving as the type I need. Any ideas.


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to save file as CSV (Comma Delimited)

    Include the FileFormat argument.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Macro to save file as CSV (Comma Delimited)

    Yes Alpha frog! That totally worked.

  4. #4
    Registered User
    Join Date
    03-24-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro to save file as CSV (Comma Delimited)

    Hello,
    I have a similar issue. My macro is working, but my VBA seems to be different then yours, Where would i enter the "FileFormat:=1CSV" on the below code?

    ThisWorkbook.Sheets("Combined").Copy Before:=wb.Sheets(1)
    wb.SAVEAS "S:\Production Department\Tracking import\Tracking Import File.NOT READY" & Format(Date, "MM.DD.YY") & ".csv"
    End Sub

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to save file as CSV (Comma Delimited)

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  6. #6
    Registered User
    Join Date
    06-01-2014
    Posts
    17

    Re: Macro to save file as CSV (Comma Delimited)

    Hello to all,

    I just used the above code. It works fantastic but is it possible just save the active sheet to csv and not changing the properties of the workbook?
    i.e. When the code is run the active sheet name changes to the exported csv name. I want to keep the workbook to the original condition without having to close (without saving) it and reopen it.

    Thank you in advance.

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to save file as CSV (Comma Delimited)

    Deleted .
    Last edited by AlphaFrog; 11-09-2014 at 03:26 PM.

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to save file as CSV (Comma Delimited)

    Try something like this...

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1