Re: Getting The Cell Index For A Function Not The Cells Value
Quote from nb-CodeDisplay MoreOption Explicit '// Test Function Public Function testfunction(targetcell As Variant, par1 As Integer, par2 As Integer) As Double Dim row%, column% row= ???????????????.targetcell '//Equivalent of =row(targetcell) column = ??????????????.targetcell '//Equivalent of =column(targetcell) testfunction = Cells(row, column) / (Cells(row - par1, column) + Cells(row + par2, column)) End Function
It Looks like simple formula:
=A1/(OFFSET(A1,-par1)+OFFSET(A1,par2))
Are you sure you need UDF?