Forum Discussion
How do you respond to...
Hello GeorgieAnne,
You can simply type "Yes, please give me the version that lists the addresses in a sheet" into the AI chat — there isn’t a hidden button for this. The AI responds to plain language, not the interface buttons.
Microsoft Documentation
Range.HasFormula property: https://learn.microsoft.com/en-us/office/vba/api/excel.range.hasformula — Returns True if all cells in the range contain formulas, False if none do.
Range.Find method: https://learn.microsoft.com/en-us/office/vba/api/excel.range.find (learn.microsoft.com in Bing) — Useful if you want to search for specific formulas or values.
To "say yes" to the AI, just type your request clearly in the chat. And if you want to explore further, Microsoft’s official VBA documentation on Range.HasFormula and Range.Find gives you the building blocks to customize how formulas are detected and listed.
Example VBA code to list formula cells in a new worksheet:
Sub ListFormulaCells()
Dim ws As Worksheet
Dim cell As Range
Dim outputWs As Worksheet
Dim rowNum As Long
Set ws = ActiveSheet
Set outputWs = Worksheets.Add
On Error Resume Next
outputWs.Name = "FormulaCells"
On Error GoTo 0
rowNum = 1
outputWs.Cells(rowNum, 1).Value = "Cell Address"
outputWs.Cells(rowNum, 2).Value = "Formula"
For Each cell In ws.UsedRange
If cell.HasFormula Then
rowNum = rowNum + 1
outputWs.Cells(rowNum, 1).Value = cell.Address(False, False)
outputWs.Cells(rowNum, 2).Value = cell.Formula
End If
Next cell
MsgBox "Formula cell addresses listed on sheet: " & outputWs.Name
End Sub
This scans the active sheet, creates a new sheet called "FormulaCells," and lists each formula cell’s address and its formula.