+ Reply to Thread
Results 1 to 6 of 6

Analaysis file and multiple csv files

  1. #1
    Registered User
    Join Date
    08-07-2011
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    34

    Analaysis file and multiple csv files

    Hi,

    I have many .csv files that have identical format (columns A to L, row 1 to 30), no header.

    I have an analysis file where, having already copied and pasted the data in one csv file, the data from A:2 to L31 is idential to one of the .csv files, since I just copied and pasted. I added a header line, so this is row 1, A:L. The next few columns (L to P) and rows (1:31) are the analysis columns, based on the data from A:2 to L31. L1:P1 is a header line. I have a "summary section" based on all the data which I arbitrarily put in cells R2,S2,T2 with corresponding head liner R1,S1,T1.

    The bottom line is that I want to be able to easily put data from any of the .csv files into the analysis file .xls
    Since I go back and forth between different .csv file, it would be awesome to have some kind of dropdown menu of the file names .csv, so i can quickly read the data into my analysis file.

    How can I do this?

    Thanks,
    Matt

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Analaysis file and multiple csv files

    The following macro code will pull out the names of all the CSV files in a folder and use them to populate a dropdown list (in A1) in this example.

    Please Login or Register  to view this content.

    This could be adapted to drive a change event driven macro to read in the selected csv file into the appropriate area of the sheet.

  3. #3
    Registered User
    Join Date
    08-07-2011
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Analaysis file and multiple csv files

    Hi OK,

    This seems like a good start...would you mind commenting the lines. I am new to the macro world (but have programmed in c++ and python)

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Analaysis file and multiple csv files

    The first section creates a comma delimited string of all the file names in the folder with the *.csv format by looping until no new names are found.

    The second section uses this string to apply validation to the specified range of cells - in this case just one.

  5. #5
    Registered User
    Join Date
    08-07-2011
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    34

    [Solved] Re: Analaysis file and multiple csv files

    OK Thanks,

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Analaysis file and multiple csv files

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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