
Use a custom function to enter all formulas
into an additional worksheet
This example inserts a new worksheet with the name Documenta-
tion. Once started, all formulas inside the active workbook will be
documented.
4
To find all formulas and enter them into a worksheet:
1. Press <Alt+F11>.
2. On the Insert menu, click Module.
3. Type the following macro:
Sub NewSheetWithFormulas()
Dim rng As Range
Dim wks As Worksheet
Dim i As Integer
With Sheets("Documentation")
i=1
For Each wks In _
ActiveWorkbook.Worksheets
For Each rng In wks.UsedRange
If rng.HasFormula = True Then
.Cells(i, 1).Value = wks.Name
.Cells(i, 2).Value = rng.Address
.Cells(i, 3).Value=""&rng.Formula ...