溢出堆栈空间问题
Dim a As String, b As String, c As String, d As String, e As String, m As String, n As String, Y As StringFunction max(a, b)
max = IIf(a > b, a, b)
End Function
Function min(a, b)
min = IIf(a < b, a, b)
End Function
Sub tSum()
a = Val(Text5(4))
b = Val(Text5(5))
c = Val(Text5(6))
m = max(a, max(b, c))
n = min(a, min(b, c))
Static s
If Text5(4) <> "" Then
s = s + 1
End If
If Text5(5) <> "" Then
s = s + 1
End If
If Text5(6) <> "" Then
s = s + 1
End If
If Text5(4).Text = "" And Text5(5).Text = "" And Text5(6).Text = "" Then
Else
Y = (Val(Text5(4)) + Val(Text5(5)) + Val(Text5(6))) / s
s = 0
Text5(7).Text = (m - n) / Y
Text5(7).Text = Format(Text5(7), "0.00%")
End If
a = Val(Text5(0))
b = Val(Text5(1))
c = Val(Text5(2))
m = max(a, max(b, c))
n = min(a, min(b, c))
Static w
If Text5(0) <> "" Then
w = w + 1
End If
If Text5(1) <> "" Then
w = w + 1
End If
If Text5(2) <> "" Then
w = w + 1
End If
If Text5(0).Text = "" And Text5(1).Text = "" And Text5(2).Text = "" Then
Else
Y = (Val(Text5(0)) + Val(Text5(1)) + Val(Text5(2))) / w
w = 0
Text5(3).Text = (m - n) / Y
Text5(3).Text = Format(Text5(3), "0.00%")
End If
End Sub
Private Sub Text5_Change(Index As Integer)
Call tSum
End Sub
运行填数后要报"溢出堆栈空间"
那位老大帮我看下要怎么改