Help with UDF Function
Hi,
Below is my code, which as a macro, works fine ...
But transposed into a Function, it does not work ...
Function PLE(Rng As Range) As Variant
Dim i, j As Integer
i = Reng.Value
j = Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByColumns).Column
PLE = Application.WorksheetFunction.Sum(Range(Cells(i, j - 2),
Cells(i, j)))
End Function
What is wrong ?
TIA
|