Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Pass cell address to fn (dumb q #327) (2000sr1a)

    I can't believe I can't find the answer to this, so sorry if it's so obvious.

    I want to pass the address of the cell containing the function (NOT the active cell) to the function. In order to execute, the function needs to know where it is. I can pass the address of the active cell, but of course that's useless in this case.

    How can I do this?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Pass cell address to fn (dumb q #327) (2000sr1a)

    Application.Caller returns a range object that contains the cell (or area in case of an array formula) whose formula calls the function.

  3. #3
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Pass cell address to fn (dumb q #327) (2000sr1a)

    Thanks Hans, but when I used Application.Caller it send the address of the active cell to the function, not the cell containing the formula. Was I doing something wrong?

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Pass cell address to fn (dumb q #327) (2000sr1a)

    application.caller.address

    is the address of the cell which is calling the function

    Steve

  5. #5
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Pass cell address to fn (dumb q #327) (2000sr1a)

    I've worked out my problem. I was trying to pass application.caller.address as an arguement, and always getting the active cell, rather than just accessing it in the function.

    Thanks

Posting Permissions

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