I need some help writing some VBA for Excel. I have a single spreadsheet with two worksheets. One worksheet is called Master, the other is called Sheet2. Here is what the Master worksheet looks like:
A B C
1 Company Name Company Interests Contact
2 Apple Inc Waterskiing
3 Grape Pty Bush walking
4 Pear Pty
5 Peach Pty Movies
6 Watermelon Pty Reading Books Bob Brown
Here is what Sheet2 looks like:
A B
1 Company Name Contact
2 Apple Inc Bruce Kemp
3 Grape Pty Steve Sampson
4 Pear Pty
5 Peach Pty
6 Watermelon Pty Bob Brown
7 Honey Pty Luis White
What I want to do is loop through all the Company Names (Column A) in worksheet Sheet2 and check against the Company Names (column A) in the Master worksheet.
If a match is found, the value contained in the Contact Column of Sheet2 (Column B) is copied to the Contact Column (column C) in Master for the correct row.
If no match is found then the entire row in Sheet2 is copied to the first empty row in the Master Sheet.