I want to create a function in VBA that has a cell and a range as input like this: MyFunction (cell1, range1)
...
End function
Calling MyFunction with input parameters cell1 = A1 and range1 = $A$1:$A$10 MyFunction should evaluate the following formula:RANK(A1,$A$1:$A$10,0)+COUNTIF(A$1:A1,A1)-1
The difficulty with this is that the input range is specified as an absolute reference ($A$1:$A$10) but the formula should use a semi-relative range in the count if statement (A$1:A1).
Can someone please show me the code to do this?
Many Thanks !
Bookmarks