在Excel工作表中查找所有数组公式

Nee*_*elp 9 excel vba array-formulas

有没有办法在给定的Excel电子表格中查找所有数组公式?

Nic*_*ssu 10

看看这个例子.希望它有所帮助.

Sub array_formula()
Dim rRange As Range, cell As Range
Dim tot As Integer
Set rRange = ActiveSheet.UsedRange.SpecialCells(xlCellTypeFormulas)
    For Each cell In rRange
        If cell.HasArray Then
            MsgBox cell.Address & " " & cell.formula
            tot = tot + 1
         End If
     Next cell
MsgBox "total number of array formula: " & tot
End Sub
Run Code Online (Sandbox Code Playgroud)