+ Reply to Thread
Results 1 to 5 of 5

Run macro on several .csv files and save as .xlsx

  1. #1
    Registered User
    Join Date
    06-03-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2013
    Posts
    15

    Run macro on several .csv files and save as .xlsx

    Hello,

    I recorded a chart macro (called "Fill_Test_Graph") which I am trying to run on a bunch of .csv files and once the chart is created save as a .xlsx file.

    All the .csv files are named as 1.csv, 2.csv, 3.csv and so on...

    So to sum it up I'm trying to:

    1. Open the .csv file
    2. Run the "Fill_Test_Graph" macro
    3. Save as .xlsx
    4. Close file
    5. Loop to the next .csv file

    Thank you.
    Attached Files Attached Files
    Last edited by pbd3mon; 11-02-2015 at 10:58 PM.

  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: Run macro on several .csv files and save as .xlsx

    Hello pbd3mon,

    To get an answer quickly, you should upload copies of a CSV file and an example XLSX workbook with the CSV data in place.
    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
    Registered User
    Join Date
    06-03-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Run macro on several .csv files and save as .xlsx

    Quote Originally Posted by Leith Ross View Post
    Hello pbd3mon,

    To get an answer quickly, you should upload copies of a CSV file and an example XLSX workbook with the CSV data in place.
    Done, thanks for the suggestion.

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Run macro on several .csv files and save as .xlsx

    Perhaps a macro like this?

    You will have to change the folder name where the csv files are stored as well as the name of the save to folder. The way the macro is set up file name will be 1.xlsx, 2.xlsx and so forth.

    Please Login or Register  to view this content.
    Alf

  5. #5
    Registered User
    Join Date
    06-03-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Run macro on several .csv files and save as .xlsx

    Thank you Alf,

    I will give that a try when I get home tonight.

+ 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. [SOLVED] Save all xls files in directory as xlsx
    By StartRunMSPaint in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2014, 04:45 PM
  2. [SOLVED] Looping through all files in a folder - save as xlsx
    By Emse_ in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-18-2014, 02:15 PM
  3. [SOLVED] how to convert multiple .txt files to .xlsx files using a macro?
    By Aaron_Tram in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-21-2013, 06:30 PM
  4. Merge Data from different .xlsx files & different sheet to a new .xlsx
    By QcSylvanio in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2012, 01:11 PM
  5. Replies: 6
    Last Post: 08-28-2012, 03:51 AM
  6. How to add the columns data of several xlsx files of a folder in another xlsx file
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-25-2012, 04:29 AM
  7. Save all .xlsx files in a directory to .xls
    By paul00 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2012, 08:05 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