How to list all formulas in Excel?
Normally, in Excel, we can quickly display formulas in the cells, but, Excel doesn’t provide a feature for listing all formulas in a worksheet. Listing all formulas of a worksheet can help us to keep trace of the cell values with its real formulas. Here, I can talk about creating a VBA code to solve this problem.
List all formulas of a worksheet with VBA code
List all formulas of a worksheet with VBA code
The following VBA code will help you to list the formulas of a selection or a worksheet, please do as follows:
1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
VBA code: List all formulas of a worksheet
Sub ListFormulas()
'Update 20141027
Dim Rng As Range
Dim WorkRng As Range
Dim xSheet As Worksheet
Dim xRow As Integer
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Set WorkRng = WorkRng.SpecialCells(xlFormulas, 23)
If WorkRng Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Set xSheet = Application.ActiveWorkbook.Worksheets.Add
xSheet.Range("A1:C1") = Array("Address", "Formula", "Value")
xSheet.Range("A1:C1").Font.Bold = True
xRow = 2
For Each Rng In WorkRng
xSheet.Cells(xRow, 1) = Rng.Address(RowAbsolute:=False, ColumnAbsolute:=False)
xSheet.Cells(xRow, 2) = " " & Rng.Formula
xSheet.Cells(xRow, 3) = Rng.Value
xRow = xRow + 1
Next
xSheet.Columns("A:C").AutoFit
Application.ScreenUpdating = True
End Sub
3. Then press F5 key to run this code, and a prompt box will pop out to remind you to select a range or the whole worksheet that you want to list its formula cells, see screenshot:
4. And then click OK, formulas in your selection have been listed at once in a new worksheet in the front of your active worksheet which contains the information of cell address, formula and value as following screenshot shown:
Related articles:
How to convert formula to text string in Excel?
How to convert text strings to formulas in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!