Adapting JBeaucaire's code (only because I'm wondering whether the OP was looking for the newest price):
Function PriceAtTheTime(CurrentDate As Date, ProductCode As String, DateCodeTable As Range) As Double
Dim dcARR, maxDate As Date, d As Long
dcARR = DateCodeTable.Value
For d = 1 To UBound(dcARR)
If dcARR(d, 2) = ProductCode And dcARR(d, 1) <= CurrentDate Then
If dcARR(d, 1) > maxDate Then
PriceAtTheTime = dcARR(d, 3)
maxDate = dcARR(d, 1)
End If
End If
Next d
End Function
Use:
=PriceAtTheTime(CurrentDate, ProductCode, DateCodeTable)
=PriceAtTheTime(A2, B2, Sheet2!$A$1:$C$12)