Attribute VB_Name = "modGrid"
'网格录入数据
'求极大值和极小值
Option Explicit
Public intCol As Integer '列数
Public intRow As Integer '行数
Public dblArray() As Double '数据
Public dblMax As Double '极大值
Public dblMin As Double '极小值
'求极大值和极小值子程序
Sub XYZ(intR As Integer, intC As Integer, dblABC() As Double)
Dim intI As Integer, intJ As Integer
dblMax = -10000000#: dblMin = 10000000#
For intI = 1 To intR
For intJ = 1 To intC
If dblABC(intI, intJ) > dblMax Then dblMax = dblABC(intI, intJ)
If dblABC(intI, intJ) < dblMin Then dblMin = dblABC(intI, intJ)
Next intJ
Next intI
End Sub