+ Reply to Thread
Results 1 to 9 of 9

Excel Macro/VBA Program That Converts To CSV

  1. #1
    Registered User
    Join Date
    08-17-2008
    Location
    London
    Posts
    18

    Excel Macro/VBA Program That Converts To CSV

    Hi, do you know if VBA in excel can create a macro or some kind of program that will take all the .XLS files in a particular folder and then create them all into .CSV format, IN ONE GO?

    So suppose I have a directory:
    C:\EXCEL_FILES

    Let's say the folder EXCEL_FILES has 4 files:
    - file_1.xls
    - apple2.xls
    - olympics.xls
    - financeoption.xls

    as you can see these files have no particular ordering to them as their file names are completely different.

    So would excel be able to simply just choose the folder (EXCEL_FILES) and then convert all those 4 files into .CSV format at the click of ONE button?

    I want the program to process all files in one go..

    Any ideas please guys?
    Your help would be very much appreciated.

    Many Thanks

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi

    Are all these files single sheet entities, or are they multi-sheet? If so, what do you want to happen to the other sheets given csv files can only be considered as single sheet files? Why do you want to do this out of interest?

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Maybe like this:
    Please Login or Register  to view this content.
    Last edited by shg; 08-23-2008 at 11:40 AM.

  4. #4
    Registered User
    Join Date
    08-17-2008
    Location
    London
    Posts
    18
    Quote Originally Posted by RichardSchollar View Post
    Hi

    Are all these files single sheet entities, or are they multi-sheet? If so, what do you want to happen to the other sheets given csv files can only be considered as single sheet files? Why do you want to do this out of interest?
    Hi, these are single sheet files so i'm hoping the csv conversions shouldn't be a problem.

    But if I did want to convert multiple sheet files to csv then is there another solution?

    The reason why I want to do this is because I have a large number of files that I want to convert to CSV fairly regularly and instead of doing them one by one I wanted to automate the process so that it is easer in the future aswell.
    I guess the whole purpose of doing work is to do as less as possible and still get the work done

  5. #5
    Registered User
    Join Date
    08-17-2008
    Location
    London
    Posts
    18
    thanks a lot for this mate.
    i will try it now.
    Last edited by shg; 08-23-2008 at 02:33 PM. Reason: deleted spurious quote

  6. #6
    Registered User
    Join Date
    08-17-2008
    Location
    London
    Posts
    18
    wow, it works like a charm. thanks very much. i really appreciate it. It's really really good :D !!!

    Just one question though: I noticed that to convert the file, the macro opens the file, saves it as CSV, closes file, and then opens the next file in the directory.

    Is there a way to convert the files to CSV without opening them?

    Suppose the computer memory was very low then it would be more feasible to convert them without having to open up the XLS first...

    any suggestions there please??

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Yes: buy more memory.

    It opens files one at a time. How much memory to you need?

  8. #8
    Registered User
    Join Date
    08-17-2008
    Location
    London
    Posts
    18
    suppose you are working with many other applications, then it is a problem if you have to open the excel file first.

    any suggestions here? thnx.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Nope, no other suggestions.

    If that was a requirement, it would have been thoughtful to mention it in your original post.

+ 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. Excel crashes due to incomplete VBA compilation?
    By RogerN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2009, 09:26 PM
  2. shifting online data comes to excel as per formula with very minimum timelag
    By cramatr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2007, 10:08 PM
  3. Excel 2003 Not Excelling in Handling 2000 .xls File
    By pands in forum Excel General
    Replies: 4
    Last Post: 02-27-2007, 05:56 PM
  4. Going insane!
    By kik in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 01-31-2007, 08:21 AM
  5. Copying data from another program into Excel as numbers
    By wmjenner in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2007, 02:04 PM

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