Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default UDF to reference the cell with the function in it

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!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,231
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default UDF to reference the cell with the function in it

Thank you! That's exactly what I needed. I fiddled about with
variations on call and called, so I was sort of on the right track.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I parse the cell reference function? Phil Excel Worksheet Functions 1 December 18th 08 12:43 PM
Reference function name from a different cell BryanDamon Excel Discussion (Misc queries) 5 July 25th 07 12:14 AM
cant seem to get a function to reference a variable cell? Archie Excel Programming 1 June 22nd 07 05:51 PM
Multiple cell reference IF function Colinhp Excel Worksheet Functions 7 June 21st 06 09:09 PM
Cell Reference in Function astrodon Excel Worksheet Functions 4 February 19th 06 06:47 PM


All times are GMT +1. The time now is 12:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"