|
解决了,这样改的:
Private Sub CommandButton1_Click()
Dim E, I, S, N, T, F, J, P, LT, A, B As Integer
For A = 17 To 112
For B = 0 To 11
If A = 17 + B * 8 Then E = Val(Me("TextBox" & A).Value) + E: GoTo 1
If A = 18 + B * 8 Then I = I + Val(Me("TextBox" & A).Value): GoTo 1
If A = 19 + B * 8 Then S = S + Val(Me("TextBox" & A).Value): GoTo 1
If A = 20 + B * 8 Then N = N + Val(Me("TextBox" & A).Value): GoTo 1
If A = 21 + B * 8 Then T = T + Val(Me("TextBox" & A).Value): GoTo 1
If A = 22 + B * 8 Then F = F + Val(Me("TextBox" & A).Value): GoTo 1
If A = 23 + B * 8 Then J = J + Val(Me("TextBox" & A).Value): GoTo 1
If A = 24 + B * 8 Then P = P + Val(Me("TextBox" & A).Value): GoTo 1
Next B
1:
If Val(Me("TextBox" & A).Value) = 0 Then LT = LT + 1 / 2
Next A
Label1.Caption = "一共48道题,你漏做了" & LT & "题,共计得" & Chr(13) & Chr(10) & "E: " & E & "分,I: " & I & "分,S: " & S & "分,N: " & N & "分,T: " & T & "分,F: " & F & "分,J: " & J & "分,P: " & P & "分!" & Chr(13) & Chr(10) & "你的优势类型为下面字母组合!"
If E > I Then TextBox113.Text = "E" Else If E = I Then TextBox113.Text = "?" Else TextBox113.Text = "I"
If S > N Then TextBox114.Text = "S" Else If S = N Then TextBox114.Text = "?" Else TextBox114.Text = "N"
If T > F Then TextBox115.Text = "T" Else If T = F Then TextBox115.Text = "?" Else TextBox115.Text = "F"
If J > P Then TextBox116.Text = "J" Else If J = P Then TextBox116.Text = "?" Else TextBox116.Text = "P"
End Sub |
|