相关代码 |
|
Attribute VB_Name = "modCalculate" '文本框数组录入数据 '计算平均值 Option Explicit Public intRow As Integer '行数 Public intCol As Integer '列数 Public dblArray() As Double '录入数据 '计算平均值函数 Function XYZ(intR As Integer, intC As Integer, ABC() As Double) As Double Dim dblSum As Double Dim intI As Integer, intJ As Integer dblSum = 0# For intI = 1 To intR For intJ = 1 To intC dblSum = dblSum + ABC(intI, intJ) '求和 Next intJ Next intI XYZ = dblSum / (intR * intC) '求平均值 End Function