Excel VBA For Loop Data Matching

If I was able to help you, feel free to donate.
Paypal: jayjaygiron102193@gmail.com
Sub match_Data()
Dim rSH As Worksheet
Dim sSh As Worksheet
Set rSH = ThisWorkbook.Sheets("RAW DATA")
Set sSh = ThisWorkbook.Sheets("SEARCH DATA")
Dim fName As String, lName As String
For a = 2 To sSh.Range("A" & Rows.Count).End(xlUp).Row
fName = sSh.Range("A" & a).Value
lName = sSh.Range("B" & a).Value
For b = 2 To rSH.Range("A" & Rows.Count).End(xlUp).Row
If rSH.Range("A" & b).Value = fName And rSH.Range("B" & b).Value = lName Then
sSh.Range("C" & a).Value = rSH.Range("D" & b).Value
sSh.Range("D" & a).Value = rSH.Range("E" & b).Value
sSh.Range("E" & a).Value = rSH.Range("F" & b).Value
sSh.Range("F" & a).Value = rSH.Range("H" & b).Value
sSh.Range("G" & a).Value = rSH.Range("J" & b).Value
Exit For
End If
Next b
Next a
Debug.Print "Completed"
End Sub

Пікірлер: 14

  • @turdmcgurd
    @turdmcgurd3 жыл бұрын

    Yo you just saved me 10 hours of work searching over 2 800+ row documents

  • @Yash1999malviya
    @Yash1999malviya Жыл бұрын

    Dude !!!!, You are a lifesaver, I was not even able to search this problem on the net, and you have the exact solution for my problem.

  • @pradeepsurendar9376
    @pradeepsurendar93769 ай бұрын

    Thank you. Saved my time❤

  • @user-te9xq7mm7t
    @user-te9xq7mm7t3 жыл бұрын

    Спасибо, это подходит!

  • @bhaveshh5786
    @bhaveshh57862 жыл бұрын

    Thank you

  • @deniskoech2636
    @deniskoech26364 ай бұрын

    Thank you . A good solution. However, how about when you have one match and multiple searches. Meaning the lookup value can be repeated each with different amounts . As it is now, it returns the first item in the loop( just as is the case with VLOOKUP) .

  • @shruthijois5492
    @shruthijois54922 жыл бұрын

    Hi , I am getting error in first for loop saying that Method range of object _worksheet failed. What is the solution for this

  • @mounika6865
    @mounika68653 жыл бұрын

    How to match set of same string array in two sheets

  • @TanvirMostofa
    @TanvirMostofa Жыл бұрын

    Dear sir, I want to know how to solution the three criteria index match function in Visual basic excel file ? Can i shear a excel file this related problem.

  • @Safeshopmillionaires5460
    @Safeshopmillionaires54602 жыл бұрын

    Hello I have used your code for Matching data transfer from one worksheet to another .. And it's working... But I also need to transfer unmatched data too . How it will done. Please help me.

  • @mohammadafsari4686
    @mohammadafsari4686 Жыл бұрын

    Thank you , question is there any way that can find 3rd date between start and finish date with formula ?

  • @LoveCodingAndPlay

    @LoveCodingAndPlay

    Жыл бұрын

    Let me check on that

  • @mohammadafsari4686

    @mohammadafsari4686

    Жыл бұрын

    @@LoveCodingAndPlay just know the task is more than 1000 , thank you 🙏

  • @cringerfringe2285
    @cringerfringe22852 жыл бұрын

    Aww, no follow up array video?