Dependents of a formula

B

Bob

Hi Everyone:

In excel VBA, is there a way to get the cell references that a formula
contains. For example, if in cell A1, I have the following formula:

=2*B1+C3-x

where x is a defined name (referencing cell D5).

So, for cell A1, I want the program to return to me B1, C3, and x (or D5).

I would appreciate a small code for this. Thanks for all your help.

Bob
 
C

Clif McIrvin

Bob said:
Hi Everyone:

In excel VBA, is there a way to get the cell references that a formula
contains. For example, if in cell A1, I have the following formula:

=2*B1+C3-x

where x is a defined name (referencing cell D5).

So, for cell A1, I want the program to return to me B1, C3, and x (or
D5).

I would appreciate a small code for this. Thanks for all your help.

Bob


I've never used this, but look at the Excel VBA help on DirectDependents

varMyTemp = Range("A1").DirectDependents.Address

might do what you want.
 
Top