View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Help with UDF Function

I don't think Find works in a UDF, it fails on the Find itself.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Carim" wrote in message
oups.com...
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