ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there anyway to find out which cell is being calculated? (https://www.excelbanter.com/excel-programming/417651-there-anyway-find-out-cell-being-calculated.html)

J. Caplan[_2_]

Is there anyway to find out which cell is being calculated?
 
I have a few user defined formulas that are in a spreadsheet. When I open
Excel with automatic calculation turned on, it goes through each cell and
executes my formulas as expected.

What I need to know is which cell is being calculated? If I have 5 cells
with one of my formulas, I would expect my formula to be called 5 times
(which it is), but I want to know which cell is being calculated each time.

Application.ActiveCell only tells you the cell where the cursor is. It does
not change as Excel iterates through each cell to calculate them.


Barb Reinhardt

Is there anyway to find out which cell is being calculated?
 
I believe you could put something like

Debug.print Application.Caller.Address

in your UDF and then look at the immediate window.
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"J. Caplan" wrote:

I have a few user defined formulas that are in a spreadsheet. When I open
Excel with automatic calculation turned on, it goes through each cell and
executes my formulas as expected.

What I need to know is which cell is being calculated? If I have 5 cells
with one of my formulas, I would expect my formula to be called 5 times
(which it is), but I want to know which cell is being calculated each time.

Application.ActiveCell only tells you the cell where the cursor is. It does
not change as Excel iterates through each cell to calculate them.


J. Caplan[_2_]

Is there anyway to find out which cell is being calculated?
 
That's it!! I knew it would be something simple, but I didn't even notice
the Caller property. Thanks!!

"Barb Reinhardt" wrote:

I believe you could put something like

Debug.print Application.Caller.Address

in your UDF and then look at the immediate window.
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"J. Caplan" wrote:

I have a few user defined formulas that are in a spreadsheet. When I open
Excel with automatic calculation turned on, it goes through each cell and
executes my formulas as expected.

What I need to know is which cell is being calculated? If I have 5 cells
with one of my formulas, I would expect my formula to be called 5 times
(which it is), but I want to know which cell is being calculated each time.

Application.ActiveCell only tells you the cell where the cursor is. It does
not change as Excel iterates through each cell to calculate them.



All times are GMT +1. The time now is 04:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com