用VBA将这个改写成自定义函数 而且不能用goto语句----://pan.baidu.com/s/1slIP89R 把----改写http可以
1 回答
炎炎设计
TA贡献1808条经验 获得超4个赞
'自定义函数不是SUB 过程,你如果不是要自定义函数,自己修改一下吧
Function
ss(rg,
ParamArray
n_arr())
As
Variant
Application.Volatile
'易失函数
Dim
nr
As
Long
, nc
As
Long
, n
As
Long
Dim
i
As
Long
, j
As
Long
, k as long
Dim
s
As
Long
Dim
arr
If
IsMissing(n_arr)
Then
ss =
"条件缺件"
Exit
Function
End
If
arr = rg
nr = UBound(arr, 1)
nc = UBound(arr, 2)
n = UBound(n_arr) + 1
For
i = 1
To
nr
For
j = 1
To
nc
For
k = 1
To
n
If
arr(i, j) = n_arr(k - 1)
Then
s = s + 1
Next
Next
If
n = s
Then
ss = ss + 1
End
If
s = 0
Next
End
Function
添加回答
举报
0/150
提交
取消