+ Reply to Thread
Results 1 to 3 of 3

getting the column address of an argument to a user defined functi

  1. #1
    Salman
    Guest

    getting the column address of an argument to a user defined functi

    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.


  2. #2
    Tom Ogilvy
    Guest

    RE: getting the column address of an argument to a user defined functi

    Function UserDefined(leftarg as range, rightarg as range) as double
    n=leftarg.column
    etc.
    End function

    --
    Regards,
    Tom Ogilvy


    "Salman" wrote:

    > 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.
    >


  3. #3
    NickHK
    Guest

    Re: 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" <[email protected]> ¼¶¼g©ó¶l¥ó·s»D:[email protected]...
    > 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.
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1