sbbmaster09
06-06-2016, 05:13 AM
Hi,
I am looking for a fastest code that will do the flow below. I have 2 workbooks wtih "maindata" and "sourcedata" sheet. The sourcedata sheet has 100+ columns and thousands of data. The maindata sheet is where all the needed data from the sourcedata sheet should be copied. maindata new sheet has already have the headers (Row 1).
The tool flows like this:
1] get the value in sheet maindata B1
2] find the value in sheet sourcedata columns 1-100
3] when the value is found or exactly the same headers, copy the entire column from sheet sourcedata to sheet maindata of the same header
4] when the value is not found, go to next value in sheet maindata C2
5] and repeat step 2 or 4 until all headers in sheet maindata are populated
Additional functions needed are:
1. Each files to be opened should have count of rows copied
2. For each file copied, column 1 should be filled up by filename
3. repeat the whole process for all the files opened
I am not yet expert to use arrays and for loops so I will be needing a help to code this.
Attach are the files. Consolidation Automation is the maindata and the 2.csv is the sourcedata.
Thank you.
I am looking for a fastest code that will do the flow below. I have 2 workbooks wtih "maindata" and "sourcedata" sheet. The sourcedata sheet has 100+ columns and thousands of data. The maindata sheet is where all the needed data from the sourcedata sheet should be copied. maindata new sheet has already have the headers (Row 1).
The tool flows like this:
1] get the value in sheet maindata B1
2] find the value in sheet sourcedata columns 1-100
3] when the value is found or exactly the same headers, copy the entire column from sheet sourcedata to sheet maindata of the same header
4] when the value is not found, go to next value in sheet maindata C2
5] and repeat step 2 or 4 until all headers in sheet maindata are populated
Additional functions needed are:
1. Each files to be opened should have count of rows copied
2. For each file copied, column 1 should be filled up by filename
3. repeat the whole process for all the files opened
I am not yet expert to use arrays and for loops so I will be needing a help to code this.
Attach are the files. Consolidation Automation is the maindata and the 2.csv is the sourcedata.
Thank you.