UDF to reference the cell with the function in it
wrote...
So I wrote this lovely Function, to be used from the worksheet. (in
the cell, you would enter = & the name of the function & parameters).
It assumes (wrongly, I see now) that the cell you're typing the
formula into is the active cell and pulls a bunch of other data based
on that. What I realized when I tried to filldown, is that it
recalculates everything based on the active cell. I need it to
calculate based on the cell that the formula actually resides in,
rather than the active cell. Any ideas on how I can tell my formula
to reference the cell it's being called from? Thanks!
Replace all references to ActiveCell with Application.Caller. You may want
to add logic that tests whether Application.Caller is of type Range.
|