Sub test()
date1 = CDate("01/01/2020")
date2 = CDate("03/01/2020")
MsgBox FindFirstDateAfterDate1([B1:B100], date1, date2)
End Sub
Function FindFirstDateAfterDate1(rng, date1, date2)
Dim x&
For i = 1 To date2 - date1
x = Application.IfError(Application.Match(CStr(CDate(date1) + i), Application.Transpose(rng.Value), 0), 0)
If x <> 0 And x < date2 Then FindFirstDateAfterDate1 = x: Exit For
Next
End Function
'****************************************************************************
Sub test2()
date1 = CDate("01/01/2020")
date2 = CDate("05/01/2020")
MsgBox FindFirstDateBeforeDate2([B1:B100], date1, date2)
End Sub
Function FindFirstDateBeforeDate2(rng, date1, date2)
Dim x&
For i = 1 To date2 - date1
x = Application.IfError(Application.Match(CStr(CDate(date2) - i), Application.Transpose(rng.Value), 0), 0)
If x <> 0 And x < date1 Then FindFirstDateBeforeDate2 = x: Exit For
Next
End Function