excel - 'Type Mismatch' when calling DateDiff function -


getting 'type mismatch' here. coding issue?

coded module 1:

function numberofrows(pdate1 date, pdate2 date) integer numberofrows = datediff("d", pdate1, pdate2) + 6 end function 

coded userform: (will called command button)

private sub insertrows() dim integer = numberofrows("sdi", "edi")  worksheets(5).rows("5:" & i).insert shift:=xldown, copyorigin:=xlformatfromleftorabove  end sub 

sdi , edi named cells within document start date , end date.


Comments