Function Madd(A As Variant, B As Variant)
Dim MC() As Variant
ReDim MC(LBound(A, 1) To UBound(A, 1), LBound(A, 2) To UBound(A, 2))
For i = LBound(A, 1) To UBound(A, 1)
For j = LBound(A, 2) To UBound(A, 2)
MC(i, j) = A(i, j) + B(i, j)
Next j
Next i
Madd = MC
End Function
Function Madd(A1 As Variant, B1 As Variant)
Dim MC() As Variant,A,B
A=A1.value : B=B1.value
ReDim MC(LBound(A, 1) To UBound(A, 1), LBound(A, 2) To UBound(A, 2))
For i = LBound(A, 1) To UBound(A, 1)
For j = LBound(A, 2) To UBound(A, 2)
MC(i, j) = A(i, j) + B(i, j)
Next j
Next i
Madd = MC
End Function作者: Scott090 時間: 2015-6-4 09:16