Код VBA:
Option Explicit
Sub test()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim position As Range, cell As Range, rng1 As Range, rng2 As Range
Dim LastRow1 As Long, Lastrow2 As Long
With ThisWorkbook
Set ws1 = .Worksheets("Sheet1")
Set ws2 = .Worksheets("Sheet2")
End With
LastRow1 = ws1.Cells(ws1.Rows.Count, "X").End(xlUp).Row
Lastrow2 = ws2.Cells(ws2.Rows.Count, "Y").End(xlUp).Row
Set rng1 = ws1.Range(ws1.Cells(1, 24), ws1.Cells(LastRow1, 24))
Set rng2 = ws2.Range(ws2.Cells(1, 25), ws2.Cells(Lastrow2, 25))
For Each cell In rng1
Set position = rng2.Find(cell, LookIn:=xlValues, lookat:=xlWhole)
If position Is Nothing Then
Debug.Print "Name was not found."
Else
ws1.Range("Y" & cell.Row).Value = ws2.Range("Z" & position.Row).Value
End If
Next cell
End Sub