I have defined a function in VBA as follows:
Sub TestFunction() Dim ArrayLength, IDvariable, IDComparisonResult, PreArrayLength As Integer ReDim NodesArray(0) PreArrayLength = 0 IDvariable = 0 . . Sort PreArrayLength End Sub
whereas the function called is as follows:
Sub Sort (PreArrayLength As Integer) . . . end sub
Above function runs nicely but if I change declaration in TestFunction() as
Dim ArrayLength, IDvariable, PreArrayLength, IDComparisonResult As Integer
my code gives me an error "ByRef Argument type mismatch" indicating the line
Can anyone point the mistake I am making in declaration or understanding the error?