+ Reply to Thread
Results 1 to 6 of 6

Custom Formula and the Refering Cell's Address

  1. #1
    Registered User
    Join Date
    02-16-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    23

    Arrow Custom Formula and the Refering Cell's Address

    Hey Everyone,

    I'm trying to write a custom formula that, based on the range between two dates, will highlight several cells to the right of it (one cell a week). Trouble is I do not know how to determine the cell's address. Do I HAVE TO include a reference to another cell in the variables i pass to the function? Or can is there some kind of "Target" cell reference that initiated the function as with the excel event routines (like Worksheet_SelectionChange)?

    Thanks in advance!
    Last edited by treyr; 06-07-2010 at 02:24 PM.

  2. #2
    Registered User
    Join Date
    02-16-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Custom Formula and the Refering Cell's Address

    Additionally, I tried to just add a reference to a cell I want to highlight. But it results in an #VALUE error. Weird...

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Custom Formula and the Refering Cell's Address

    Not sure I follow, but this might start you off:
    Please Login or Register  to view this content.
    E.g.
    Please Login or Register  to view this content.
    and type =Refer() in a cell.

  4. #4
    Registered User
    Join Date
    02-16-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Custom Formula and the Refering Cell's Address

    Hey,

    Thanks for the quick response. And that is exactly what I was looking for! But now I have the same problem as when I specifically passed a target cell. It produces a #VALUE! error when I try to change the fill color of a cell. Is there any reason why this would not be allowed?

    Please Login or Register  to view this content.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Custom Formula and the Refering Cell's Address

    You cannot format cells from a UDF.
    Remember what the dormouse said
    Feed your head

  6. #6
    Registered User
    Join Date
    02-16-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Custom Formula and the Refering Cell's Address

    Hum...

    Good to know, Thanks Romper, Thanks Stephen!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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