Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifying the cells contained in a formula 2

Status
Not open for further replies.

popper

Programmer
Dec 19, 2002
103
AU
Hi

Using VBA, I want to be able to examine a formula in an Excel cell and generate a list of cells referred to in it. Anyone know how to do this?

With thanks in advance


 
You will need to use the precedents property. Not knowing exactly what you want, hopefully something in the following will help.

Code:
Sub listdeps()
For Each i In ActiveCell.Precedents
    MsgBox i.Address
Next i
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top