您可以使用Application.WorksheetFunction.SumIf函数来将内部数组作为参数进行求和。下面是一个代码示例:
Sub SumInternalArray()
Dim arr() As Variant
Dim sumResult As Double
' 定义内部数组
arr = Array(1, 2, 3, 4, 5)
' 计算内部数组的和
sumResult = Application.WorksheetFunction.SumIf(arr, ">=1")
' 输出结果
MsgBox "内部数组的和为: " & sumResult
End Sub
在上面的示例中,我们首先定义了一个包含数字的数组arr。然后,我们使用Application.WorksheetFunction.SumIf函数来计算数组中大于或等于1的元素的和。最后,我们使用MsgBox函数将结果输出到消息框中。
请注意,Application.WorksheetFunction.SumIf函数的第一个参数是范围,但我们可以使用数组作为范围来达到将内部数组作为参数的目的。