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 current cell in user-defined function

Julio,

You can't get the cell details (AFAIK), but you could pass it to the
function, for example

Function foo(rng As Range)
If rng.Count = 1 Then
foo = rng.Row
End If
End Function

and call it like so
=foo(A24)

By making it a relative reference, it will update as you copy to other
cells.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Julio Kuplinsky" wrote in message
...
Is the current cell (not the active cell) available in a
user defined function? For instance, can I say

public function foo()

' Give me the row of the worksheet cell where this
' function is entered

end function

Thanks