Sometimes it is the people no one can imagine anything of who do the things no one can imagine.
- Alan Turing

Top Ten Tags

Who's Online

You can manually follow the dependency chain of a formula, i.e. see how cell formulas flow or progress through a sheet, using a combination of CTRL, SHIFT, and the two square brackets, i.e. [ & ]. Let's say you have the following on a sheet in Excel:

  A Formula
1 1 1
2 2 =A1+1
3 2 =A2
4 4 =A2*2

If you select cell A1, then press CTRL + ], cell A2 will be selected. If you press CTRL + ] again, the range A3:A4 will now be selected since both of those are dependent on B2.

If you select A4 and press CTRL + SHIFT + ], the range A1:A2 will now be selected since A4 relies on them, on A2 directly and A1 indirectly (since A2 is dependent on A1). If you go back and re-select cell A1, then press CTRL + SHIFT + ], cell A2:A4 will be selected, because those all rely on A1 either directly or indirectly.

Cells on the active sheet takes precedence over cells on other sheets when navigating the dependency chain. From what I can tell CTRL + ] doesn't work in navigating to a dependent cell on another sheet, but CTRL + [ seems to work to go to a precedent cell on another sheet.

Manually 'navigating' formula references / dependencies of precedents and dependents: Keyboard Shortcuts

Ctrl + ]
Select the cells that are direct dependents of the active cell.
Ctrl + [
Select the cells that are direct precedents of the active cell.
Ctrl + Shift + [
Selects all the cells that are direct or indirect dependents.
Ctrl + Shift + ]
Selects all the cells that direct or indirect precedents.

Showing ALL trace dependents / precedents arrows

Sometimes I want to know if there are any sheets referenced from the current worksheet that I'm on. Perhaps I want to delete it and ensure that I won't be breaking any links. Or I may need to know if are any links to another sheet. One way is to search for "!" in a formula, or you can manually select individual cells and click the trace dependents/precedents until you hit the end. But that's not really an option for even a medium size range.

Microsoft Excel does have a feature to do this, called Worksheet Relationship. But it requires that you turn on the Inquire Add-On (COM add-in), which sometimes isn't an option on a work computer. And if your version of Office doesn't have it, then you need another way.

So I wrote up the following code to keep in my 'personal' workbook. It's not an all-encompassing view of the workbook, but it does help me look at the current worksheet.

VBA Code

Sub TraceAllDependants()

1   On Error GoTo ErrMsg

2   Application.ScreenUpdating = False
3   Application.Cursor = xlWait

4   Range(Range("A1"), ActiveCell.SpecialCells(xlLastCell)).Select
5   For Each c In Selection
6       c.ShowDependents
7   Next c

ExitHere:
8   Application.StatusBar = ""
9   Application.ScreenUpdating = True
10  Application.Cursor = xlDefault
11  Exit Sub

ErrMsg:
12  MsgBox "An error has occurred @ line # " & Erl & _
           " in TraceAllDependants()." & vbNewLine & vbNewLine & _
           "Error Number:" & Err.Number & " (" & Err.Description & ").", _
           vbCritical, "Error!"
13  Debug.Print "TraceAllDependants()"
14  Debug.Print "Err.Number = " & Err.Number
15  Debug.Print "Err.Description = " & Err.Description
16  Debug.Print "Erl = " & Erl
17  Resume ExitHere

End Sub


Sub TraceAllPrecedents()

1   On Error GoTo ErrMsg

2   Application.ScreenUpdating = False
3   Application.Cursor = xlWait

4   Range(Range("A1"), ActiveCell.SpecialCells(xlLastCell)).Select
5   For Each c In Selection
6       c.ShowPrecedents
7   Next c

ExitHere:
8   Application.StatusBar = ""
9   Application.ScreenUpdating = True
10  Application.Cursor = xlDefault
11  Exit Sub

ErrMsg:
12  MsgBox "An error has occurred @ line # " & Erl & _
           " in TraceAllPrecedents()." & vbNewLine & vbNewLine & _
           "Error Number:" & Err.Number & " (" & Err.Description & ").", _
           vbCritical, "Error!"
13  Debug.Print "TraceAllPrecedents()"
14  Debug.Print "Err.Number = " & Err.Number
15  Debug.Print "Err.Description = " & Err.Description
16  Debug.Print "Erl = " & Erl
17  Resume ExitHere

End Sub

Additional Links