Is there a way to implement such a statement in VBA ?

{=MATCH(1;(R_CODES=C_SEARCHCODE)*(R_FROM<=C_SEARCHDATE);0)}

This works in a cell but I need to create a VBA function that retrieves a
value based on arguments and use it in a subroutine.