Thread: Formulas List
View Single Post
  #3   Report Post  
Harlan Grove
 
Posts: n/a
Default

"Earl" wrote...
How do I print a list of all formulas contained in a worksheet?


Using a macro would be one way. Here's one that prints just formulas in both
A1 and R1C1 formats from the active workbook to text files.


Sub fl()
Dim fd As Variant, ws AS Worksheet, c As Range

fd = Freefile
Open ActiveWorkbook.Fullname & ".fl.txt" For Output As #fd
On Error GoTo CleanUp

For Each ws In ActiveWorkbook.Worksheets
Print #fd, ws.Name

For Each c In ws.UsedRange
If c.HasFormula Then
Print #fd, c.Address(0,0)
Print #fd, "", c.Formula
Print #fd, "", c.FormulaR1C1
Print #fd, ""
End If
Next c

Print #fd, "------------"
Print #fd, ""
Next ws

CleanUp:
Close #fd
End Sub