LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Relative cell value in function

You can use Application.caller to return a range reference to the cell that
contains the function, but you cannot get its value in any straightforward
way. One possible way is to use Application.Caller.Text, but that returns
the formatted value rather than the actual value (could return ###### for
instance) so is very dependent on the user formatting etc.

To get the cell one to the left you could use
OFFSET(application.caller,-1,0,1,1)
but this would require you to make the function volatile
(Application.Volatile), which could slow down recalculation.

A better way would be to pass the cell to the left as a parameter to the
function.

You can use ISEMPTY() to determine if an input parameter has not yet been
calculated.

Charles
__________________________________________________
Outlines for my Sessions at the Australia Excel Users Group
http://www.decisionmodels.com/OZEUC.htm

"Humphrey" wrote in message
...
I have a large spreadsheet the uses a function to calculate the cell value.
I have two questions;
* is it possible to determine the value in the cell before the function is
run?
* is it possible to determine the value in the cell immediately to the
left?

I've tried using ActiveCell.Offset but the result is always coming back as
Empty. Any thoughts?

H



 
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
Relative VBA function Brian Excel Programming 2 November 29th 06 06:02 PM
Relative addressing with INDIRECT function john Excel Programming 7 June 8th 06 11:09 AM
Split function to get a relative path Jon[_21_] Excel Programming 1 April 2nd 06 11:56 PM
Get Relative Data from result of MIN function bigmacrox Excel Programming 0 January 4th 06 10:48 PM
Indirect function - relative reference Vladimir[_2_] Excel Programming 3 February 5th 04 09:05 PM


All times are GMT +1. The time now is 03:43 AM.

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"