Current location - Loan Platform Complete Network - Big data management - Use excel vba to solve the following problem
Use excel vba to solve the following problem

Actually, you can use formulas to do this, and since you specified VBA, I'm guessing you have an interest in learning it, but of course VBA is amazingly fast when it comes to big data:

Sub?ygb()

Dim?db,?arr,?i,?k

Set?db?=?CreateObject(" scripting.dictionary")

arr?=?Sheets(1).UsedRange

For?i?=?2?To?UBound(arr)

k?=?arr(i,?1)? &?arr(i,?2)

db.Add?k,?Array(arr(i,?3),?arr(i,?4),?arr(i,?5))

Next?i

Sheets(2).Select

For?i?=?1?To? Sheets(2).UsedRange.Rows.Count

k?=?Cells(i,?1)? &?Cells(i,?2)

If?db.Exists(k)?Then?Cells(i,?3).Resize(1,?3)? =?db(k)

Next?i

End?Sub

The above code is completely correct during my testing, if you encounter problems there, it may be a problem with the order of the form: the 1st worksheet on the left is the original information, the 2nd needs to be filled in the number of, if there is a change you can modify yourself.

If you encounter problems in the implementation, please copy and paste two things: the error box of the program error, press the "debug" button to retain the code window with a yellow bar.