写了一个自定义函数Function FFQiuhe(ParamArray Arr1()) As String……end Function此函数支持A1=FFQiuhe(B1,C1,D1,E1)但是不支持A1=FFQiuhe(B1:E1)
1 回答

海绵宝宝撒
TA贡献1809条经验 获得超8个赞
给你参考的
Public Function udSum(ParamArray x()) As Double
Dim i As Integer
Dim j As Integer
Dim k As Integer, One
Dim rtn As Double
rtn = 0
For i = 0 To UBound(x)
Select Case TypeName(x(i))
Case "Range"
For j = 1 To x(i).Rows.Count
For k = 1 To x(i).Columns.Count
rtn = rtn + x(i).Cells(j, k)
Next k
Next j
Case "Variant()"
For Each One In x(i)
rtn = rtn + One
Next One
End Select
Next i
udSum = rtn
End Function
- 1 回答
- 0 关注
- 84 浏览
添加回答
举报
0/150
提交
取消