+ Reply to Thread
Results 1 to 5 of 5

need to amend code to export to csv file

  1. #1
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    need to amend code to export to csv file

    Hi
    I need to amend the following code to export to an actual .csv file.

    Apparently it's only doing a excel file with a csv extention. It needs to be an actual csv file for other purposes. Can you please help?

    thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need to amend code to export to csv file

    Hello BillDoor,

    There are other ways to create a CSV file. It is important to know how certain data is to be represented like dates. Does the text need to be enclosed in double quotes?

    If you can post an actual sample CSV file that would help a lot.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    Re: need to amend code to export to csv file

    Hi

    I don't have an example at the moment, basically I'm doing something for a friend, but I'm on Windows and he's on Mac, he needs the CSV file to have Unix line endings??? as it's being imported into a website by someone else.

    All that's in the file are numbers and text, no real formatting required

    Thanks

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need to amend code to export to csv file

    Hello Bill,

    Add a new VBA Module to your workbook and paste this macro into it. This will read a Windows file and convert it into UNIX format.

    NOTE: This macro will only run under Windows. The Mac does not support all of the VBA features used in Windows.

    Macor to Cteate a UNIX CSV File
    Please Login or Register  to view this content.
    Example of Using the Macro
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-13-2012
    Location
    Shropshire, England
    MS-Off Ver
    Excel 2007 /10 /13
    Posts
    118

    Re: need to amend code to export to csv file

    thanks for that, sorry for delay in closing thread

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with code: amend file path
    By jp84 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2013, 11:00 PM
  2. VBA Code to export to .txt file - Needs tweaking
    By tomjackuk in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-08-2012, 09:51 AM
  3. Code to export data to a .dat file
    By aadarsh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2010, 04:13 AM
  4. Amend Code - Save file with cell as name from different sheet.
    By Sirishgreen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2007, 05:32 AM
  5. [SOLVED] Import VBA Code in Excel-File ? (Export VBA Code to file)
    By Matthias Pospiech in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2005, 01:06 PM

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