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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top