HTML:
Public Function bidsearch(monthyear As String, k As Double) As Double
Dim searchrange As Range
Dim dummy As Range
Set searchrange = Range("bbg_strike", Range("bbg_strike").End(xlDown))
For Each dummy In searchrange
If dummy.Value = k And dummy.Offset(-1, 0) = monthyear Then
bidsearch = dummy.Value.Offset(2)
Else
bidsearch = "error"
End If
Next dummy
End Function
Does anyone have any idea why this return "#VALUE!"?
Thanks!