This works for me.
In a module:
Function GetRange() As Range
Set GetRange = ActiveSheet.Range("A1:A5")
End Function
In a worksheet formula:
=AVERAGE(GetRange())
Maybe you could post your UDF ?
Tim.
"xcelion" wrote in message
...
Hi All, 
Iam new to Vba coding .I have a foumula
=PERCENTRANK(CategoryLookup!$F$10:$G$10,D4,3) In this formula the first
parameter ie "CategoryLookup!$F$10:$G$10 " is a range that is to be
dynamcally generated based on some
lookup values.So i tried wriiting a User Defined Fuction(UDF) returning
that range based on some logic.But it's not working .What can be the
problem.Is it possible to substitute a range parameter in a worksheet
function using a UDF returning range.Can anybody help me on this
Thanks in advance
Xcelion
--
xcelion
------------------------------------------------------------------------
xcelion's Profile:
http://www.excelforum.com/member.php...o&userid=16287
View this thread: http://www.excelforum.com/showthread...hreadid=313732