VBA Code to copy a cell when a match is found

mecerrato

Board Regular
Joined
Oct 5, 2015
Messages
174
Office Version
  1. 365
Platform
  1. Windows
I am kinda new to VBA and have been using VBA to increase my efficiency and to analyze data faster so my VBA coding skills are not so great. This particular problem has me a bit lost as I have tried googling to get some code that I can modify but can't seem to find anything that does what I need.
Everyday I paste new data from a source report onto my sheet and then run code to remove duplicates based on a time stamp. So when I paste the data I have duplicate loan numbers but with updated information. However column "T" is the referral source which is a field that is NOT on my source data so when I paste the data and run the remove duplicates code I lose the referral source information because it is on the older record that gets deleted as a duplicate.
So I need code that will first search to see if the loan number exists in the old data (on the same sheet as in the example below) and if it has data in column "T" I want it to copy it to the new row.
In the example below the first record and 2nd record both have the same loan number but the 2nd record has "Joe Realtor" in column "T".

What code can I run to search every duplicate loan number and copy the value of column "T" to the record with the matching loan number that does not have a value in column "T"?

2020-05-26 21_19_13-Luis Pipeline Report V5mm.xlsm - Excel.png
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,214,387
Messages
6,119,222
Members
448,877
Latest member
gb24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top