Hi,
I have a workbook where I need to combine/merge data from one sheet into the other. However, one of the sheets has multiple records for the same lookup criteria (PERNR: Personnel Number, BEGDA: Start Date) but not the other. Hence I need to duplicate rows in the sheet with single records (IT8) so that the sheet with multiple records (IT0) can be assimilated.
In the attached example, I want to map each individual record in IT0 to one in IT8 by concatenating and vlooking up both PERNR and BEGDA. The check column indicates that there are multiple IT0 records for the same PERNR on the same BEGDA. I intend to pivottable the data later as well to display the number of affected IT8 and IT0 records separately.
Currently, a vlookup done in IT8 will only provide details of the first IT0 record for the corresponding PERNR and BEGDA (as in sheet "Current"). Is there a macro to:
1) Add new rows to the multiple records respectively? (i.e. 2 rows for IT0 records with same PERNR/BEGDA, 3 rows for 3, 4 rows for 4...) - Sheet Step 1
2) Copy the existing IT8 records into the blank rows? (i.e. Duplicating the IT8 records of the same PERNR/BEGDA) - Sheet Step 2
[1+2 = Duplicate IT8 records to so that each IT0 record can be mapped to each IT8]
3) Filling in the multiple IT0 records which were skipped by vlookup? (i.e. Mapping each individual IT0 to an IT8) - Result
Or is there any other non-manual way (formula, etc.) to merge the sheets as there are thousands of records?
Thanks!
Bookmarks