![]() |
[Help!] CSV(s) -- xls
Hi all,
I'm new to the world of excel programming. Please help me, as this problem bothers me for quite a long time. I have many .csv files (generated by programmes), all I want to do is comparing those files and do some analysis (eg. charting). How can I automate the whole process? Eg. I have to .csv files. A.csv and B.csv (they can be as simple as a name and a value to compare, eg. SALARY, 60). How can I: 1. create a AB.xls file contain these two worksheets 2. plot a chart for comparison in a new worksheet in the same AB.xls file. (eg. BAR chart to compare SALARY of A & B) How can they be achived (programs, scripts, etc) by not manually?! Thanks!!! |
[Help!] CSV(s) -- xls
set wb1 = workbooks.open "C:\CSV\a.csv"
set wb2 = workbooks.open "C:\CSV\b.csv" wb1.worksheets(1).Columns(1).Resize(2).copy _ Destination:=wb1.worksheets(1).Range("D1") wkb2.close savechanges=false wb1.SaveAs filename:="C:\Archive\ab.xls", fileformat:=xlWorkbookNormal ' code to do the comparison - the term compare is not self defining. ' may include a sort of A:B then sort of D:E assumes all names will ' match, then set rng = Range(Cells(1,1),Cells(rows.count,1).End(xlup)) rng.offset(0,6).Formula = "=A1" rng.offset(0,7).Formula = "=E1-B1" ' this gives a difference column as an example ' code to do plot (should be able to get with the macro recorder) wb1.Save wb2.Close SaveChanges:=False -- Regards, Tom Ogilvy "Catherine" wrote in message ... Hi all, I'm new to the world of excel programming. Please help me, as this problem bothers me for quite a long time. I have many .csv files (generated by programmes), all I want to do is comparing those files and do some analysis (eg. charting). How can I automate the whole process? Eg. I have to .csv files. A.csv and B.csv (they can be as simple as a name and a value to compare, eg. SALARY, 60). How can I: 1. create a AB.xls file contain these two worksheets 2. plot a chart for comparison in a new worksheet in the same AB.xls file. (eg. BAR chart to compare SALARY of A & B) How can they be achived (programs, scripts, etc) by not manually?! Thanks!!! |
All times are GMT +1. The time now is 11:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com