View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
NickHK[_3_] NickHK[_3_] is offline
external usenet poster
 
Posts: 415
Default getting the column address of an argument to a user defined functi

You can't get the address of a "leftarg" because it declared as a Double and
as such does not have an address.
If you pass the range, then you can. e.g.
Function UserDefined(leftarg as Range, rightarg as Range) as double
Dim ColNum As Long
Dim WS As Worksheet

ColNum=leftarg.column
Set WS=leftarg.Parent
....etc

NickHK

"Salman" ...
Hi I want to write a UDF in which I will need to access the column numbers
of
function arguments from inside the body of the function. Example code is:

Function UserDefined(leftarg as double, rightarg as double) as double
n=worksheet columnnumber of leftarg
etc.
End function

Is there an easy way to access the column or worksheet address of a
function's arguments?

Thanks.