我在 VBA 中编写了一个函数,但我不知道如何调用它。
Public Function FindTwoStrings(rng As Range, s1 As String, _
s2 As String) As Integer
'Application.Volatile
If TypeName(rng) <> "Range" Then Exit Function
Dim cell As Range
Dim accumulator As Integer
For Each cell In rng.Cells
If (InStr(1, UCase(cell.Value), UCase(s1), _
vbTextCompare) > 0) Or (InStr(1, UCase(cell.Value), _
UCase(s2), vbTextCompare) > 0) Then _
accumulator = Me.Cells(cell.Row, 5) + accumulator
Next cell
End Function
如何在我的单元格中调用此函数?我试过做,=Find....
但它找不到我的功能。有没有我缺少的设置?