|
Private Sub CommandButton1_Click()
Dim E, I, S, N, T, F, J, P, LT, A As Integer
E = 0
I = 0
S = 0
N = 0
T = 0
F = 0
J = 0
P = 0
LT = 0
For A = 17 To 105 Step 8
E = Val("TextBox" & A) + E
Next A
For A = 18 To 106 Step 8
I = Val("TextBox" & A) + I
Next A
For A = 19 To 107 Step 8
S = Val("TextBox" & A) + S
Next A
For A = 20 To 108 Step 8
N = Val("TextBox" & A) + N
Next A
For A = 21 To 109 Step 8
T = Val("TextBox" & A) + T
Next A
For A = 22 To 110 Step 8
F = Val("TextBox" & A) + F
Next A
For A = 23 To 111 Step 8
J = Val("TextBox" & A) + J
Next A
For A = 24 To 112 Step 8
P = Val("TextBox" & A) + P
Next A
For A = 17 To 111 Step 2
If "TextBox" & A = "" And "TextBox" & (A + 1) = "" Then LT = LT + 1
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 TextBox113.Text = "I"
If S > N Then TextBox114.Text = "S" Else TextBox114.Text = "N"
If T > F Then TextBox115.Text = "T" Else TextBox115.Text = "F"
If J > P Then TextBox116.Text = "J" Else TextBox116.Text = "P"
End Sub
运行完变量都为0,恳请指正,谢谢! |
|