Excel自定义项以统计错误
我试图在Excel VBA中编写一个UDF,用于计算错误(#NA!,#REF!…)。 我试图将Excel公式翻译成VBA语言,但没有成功。 有人知道解决办法吗 谢谢怎么样Excel自定义项以统计错误,excel,vba,count,user-defined-functions,excel-udf,Excel,Vba,Count,User Defined Functions,Excel Udf,我试图在Excel VBA中编写一个UDF,用于计算错误(#NA!,#REF!…)。 我试图将Excel公式翻译成VBA语言,但没有成功。 有人知道解决办法吗 谢谢怎么样 Public Function CountErr(cells As range) As Long Dim cell As range For Each cell In cells If Application.WorksheetFunction.IsError(cell) Then CountErr =
Public Function CountErr(cells As range) As Long
Dim cell As range
For Each cell In cells
If Application.WorksheetFunction.IsError(cell) Then CountErr = CountErr + 1
Next
End Function