trace all precedents or dependents

D

Dave F

Hi,

Is there some code I can use to automatically trace all precedents or
dependents of a cell?

I.e., a macro or module which I can assign to a button?
 
N

Niek Otten

They're readily available. View>Toolbars>Formula auditing

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Hi,
|
| Is there some code I can use to automatically trace all precedents or
| dependents of a cell?
|
| I.e., a macro or module which I can assign to a button?
 
D

Dave F

That method required multiple clicks. I'm interested in code which I can
assign to a button, click once, and have the all of the cell's precedents or
dependents displayed with tracer arrows.
 
T

Tom Ogilvy

if they are on the same sheet, look at the

directPrecedents
directDependents
Precedents
Dependents
properties of the range class.

If they are off sheet or links, then it gets much much harder.
 
D

Dave F

Thanks, Tom. For now I'm just thinking of precedents and dependents on the
same sheet...
 
T

Tom Ogilvy

My previous post doesn't show the arrows. To do that the easiest way to get
the code is to:
Turn on the macro recorder (tools menu -> macro -> record a new macro) while
you do it manually. Turn off the macro recorder. Then modify the recorded
code to achieve those same results.
 
N

NickHK

Dave,
There is the
ActiveCell.ShowDependents False
which adds the next level of dependents' arrow each time you call it.
I don't see an easy way to know when you have reached the end though.

NickHK
 

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