Hi Everyone,
I have a problem that I am not sure how to solve. I have searched the forums and found some code that is close, but doesn't quite do what I need it to. Hopefully someone can help me out.
Summary: I need to copy and overwrite rows of data from one sheet to another sheet but with a little logic. I want to look at the data in a specific column on both sheets. If there is a match, then I want the data from that specific row in the sheet 1 to overwrite the matching row in the sheet 2. If there isn't a match in the sheet2, I want the row from sheet 1 to be added to the bottom of sheet2. Lastly, I want to keep all entries in sheet 2 that do not have a match.
Detail: I have attached a workbook with sample data. The data in sheet 1 (GWI022712) comes from a system that exports a CSV file. This sheet is updated every week and contains the latest data from a 6 month window. Column D has a unique ticket number that I want to try to match in sheet 2. Sheet 2 (GWI MASTER DATA) contains the same columns as sheet 1 and needs to be updated with the latest data from sheet 1. What I want to do is compare column D on both sheets and if a match is found, update the entire row on sheet 2 with the data from the matching row on sheet 1. New entries on sheet 1 that do not have a corresponding match on sheet 2 should be added to the bottom of sheet 2. Finally, older entries in sheet 2 that do not have a match (over 6 months old) should not be deleted. Obviously, I don't want to match the column header.
I would really appreciate any help offered. Thanks!
~CS
EDIT: Forgot one thing, I would like to reserve the last few columns on Sheet 2 for formulas so I don't want them to be deleted when the macro runs. Or I would need a way to quickly replicate them to the bottom of the sheet if they are overwritten.
Bookmarks