简单写了下,经测试10组不同数据,和你的代码得到的结果一样,代码如下:
Dim i As Integer, j As Integer, k As Integer, a As String
Dim DB As Single, m As Single
Dim d
d = Array(Array(200, 180, 160, 140, 125, 110, 100, 90, 80), Array(180, 162, 144, 126, 112, 99, 90, 81, 72), Array(160, 144, 128, 112, 100, 88, 80, 72, 64), Array(140, 126, 112, 98, 88, 77, 70, 63, 56), Array(120, 108, 96, 84, 75, 66, 60, 54, 48), Array(100, 90, 80, 70, 62, 55, 50, 45, 40), Array(80, 72, 64, 56, 50, 44, 40, 36, 32), Array(60, 54, 48, 42, 37, 33, 30, 27, 24), Array(40, 36, 32, 28, 25, 22, 20, 18, 16), Array(20, 18, 16, 14, 12, 11, 10, 9, 8), Array(0, 0, 0, 0, 0, 0, 0, 0, 0), Array(-20, -18, -16, -14, -12, -11, -10, -9, -8), Array(-40, -36, -32, -28, -25, -22, -20, -18, -16), Array(-60, -54, -48, -42, -37, -33, -30, -27, -24), Array(-80, -72, -64, -56, -50, -44, -40, -36, -32), Array(-120, -108, -96, -84, -75, -66, -60, -54, -48), Array(-160, -144, -128, -112, -100, -88, -80, -72, -64), Array(-200, -180, -160, -140, -125, -110, -100, -90, -80))
a = "vutsrpnmkjhgfedcba"
j = InStr(a, Trim(Text3)) - 1
If j < 0 Then j = 0
DB = Val(Text1.Text)
m = Val(Text2.Text)
i = 1
If m > 4 Then i = 0
If m <= 1.5 Then i = 2
k = 6
While DB > 12
DB = DB / 2
k = k - 1
Wend
If k < 0 Then k = 0
i = i + k
MsgBox d(j)(i)