Excel macro to do calculations on csv files

Closed
Shaun - Jun 8, 2010 at 11:14 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jun 8, 2010 at 01:33 PM
Hi,

I have multiple comma delimited text files that are generated from an analytical instrument.

What I want to do is be:

(1) Able to select multiple comma delimited text files in a directory that I want to crunch the numbers on

(2) Have the macro calculate an average and standard deviation on the values in particular columns (it will be the same set of columns) in each file

(3) Write that data out to a separate spreadsheet (or the active workbook or whatever) as a row of data with the averages and accompanying standard deviations, and also write out the name of the file that the data was generated from.

What I have done so far is fairly inelegant I think - basically I have a macro that will insert each file into a separate worksheet in a workbook which I then need to manually crunch the numbers on, but I think it should be possible to do what I have described above without having to manually insert each sheet into a work book.

If anyone thinks they can help I can send then an example of the text file, along with more details.

Thanks very much,

Shaun
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 8, 2010 at 01:33 PM
Could you please upload a sample file with sample data etc on some shared site like http://www.sapeedyshare.com/ , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc and post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too
0