Sub test()
Dim lastrow1 As Integer, lastrow2 As Integer
lastrow1 = ThisWorkbook.Sheets(1).Cells(Rows.Count, 1).End(xlUp).Row
lastrow2 = ThisWorkbook.Sheets(2).Cells(Rows.Count, 1).End(xlUp).Row
For a = 2 To lastrow1
For b = 2 To lastrow1
If (Sheets(1).Cells(a, 1).Value = Sheets(2).Cells(b, 1).Value) And Sheets(2).Cells(b, 2).Value = "" Then
Sheets(2).Cells(b, 2).Value = Sheets(1).Cells(a, 2).Value
Exit For
End If
Next b
Next a
End Sub