Microsoft Office Tutorials and References

In Depth Information

**Displaying and Printing Formulas**

Displaying and Printing Formulas

When you enter a formula into a cell, Excel displays the calculated value of the formula. To view

a formula, activate the cell; Excel shows the formula on the Formula bar.

To view all your formulas, switch to Formula view. The easiest way to switch to this mode is to

press Ctrl+`. (That’s the accent character, usually located above the Tab key.) Excel then displays

the formulas rather than their results. In addition, you can also see which cells are referenced by

the selected formula because Excel displays those cells with a colored border. Figure 84-1 shows

a worksheet in Formula view. D8 is the selected cell, and it references cells B8 and C8, which are

displayed with a colored border.

Figure 84-1:
Excel’s Formula view displays the formulas rather than their results.

In Formula view, you can use all Excel commands and even modify the formulas.

In practice, you might find that Formula view isn’t very useful. Although Excel widens the

columns, you can see an entire formula only if it’s very short. And, if you print the sheet in Formula

view, you usually end up with a meaningless mess.

To document a worksheet by printing its formulas, your best bet is to locate a VBA macro to do

the job. This simple no-frills VBA procedure makes a list of all formulas on the active worksheet:

Sub ListFormulas()

Dim FormulaCells As Range

Dim FormulaSheet As Worksheet

Dim Row As Long

Dim Cell As Range

On Error Resume Next

Set FormulaCells = Range(“A1”).SpecialCells(xlFormulas, 23)

If FormulaCells Is Nothing Then Exit Sub

Set FormulaSheet = ActiveWorkbook.Worksheets.Add

Row = 1

For Each Cell In FormulaCells

With FormulaSheet

Cells(Row, 1) = Cell.Address(False, False)