Todor Penchev
New Member
- Joined
- Aug 1, 2017
- Messages
- 1
Hello everyone,
I am very new to VBA (I have used it for some minor tasks), but at the moment I am faced with a challenge and I am not sure how to approach it.
The task is as follows:
1). I have two folders (two different locations) which contain a number of .csv files (200+)
2). What I need to do is to loop through each file in each of the two folders, extract a single row of data from each of the files to a new workbook, which will contain the macro, where the row titles is for example “Lemons” in one of the files and “Lemon_s” in the other file, and compare the two rows.
3). A potential problem I though of is how I can know which files to match (ie knowing which two files out of 200 in each folder to compare). Potentially I though I could use some common word in both of the file names e.g. one pair of files is called “Lemons_Belgium” and “Lemon_s_Belgium” another pair would be "Lemons_Austria" and "Lemon_s_Austria" - so I could use the common word in each of the files. However, I am not sure how I could do any of the things
outlined above.
Any help will be greatly appreciated.
Thank you very much in advance for your time.
Best,
T
I am very new to VBA (I have used it for some minor tasks), but at the moment I am faced with a challenge and I am not sure how to approach it.
The task is as follows:
1). I have two folders (two different locations) which contain a number of .csv files (200+)
2). What I need to do is to loop through each file in each of the two folders, extract a single row of data from each of the files to a new workbook, which will contain the macro, where the row titles is for example “Lemons” in one of the files and “Lemon_s” in the other file, and compare the two rows.
3). A potential problem I though of is how I can know which files to match (ie knowing which two files out of 200 in each folder to compare). Potentially I though I could use some common word in both of the file names e.g. one pair of files is called “Lemons_Belgium” and “Lemon_s_Belgium” another pair would be "Lemons_Austria" and "Lemon_s_Austria" - so I could use the common word in each of the files. However, I am not sure how I could do any of the things
outlined above.
Any help will be greatly appreciated.
Thank you very much in advance for your time.
Best,
T