侃侃无极
Private Sub Command1_Click()a: Text1 = Trim(InputBox("请输入姓名", "姓名"))If Text1 = "" ThenMsgBox "未输入完整,请重新输入"GoTo aEnd Ifb: Text2 = Trim(InputBox("请输入班级", "班级"))If Text2 = "" ThenMsgBox "未输入完整,请重新输入"GoTo bEnd Ifc: Text3 = Trim(InputBox("请输入年级", "年级"))If Text3 = "" ThenMsgBox "未输入完整,请重新输入"GoTo cEnd Ifd: Text4 = Trim(InputBox("请输入科目1分数(0-100)", "科目1"))If IsNumeric(Text4) And Text4 <> "" ThenIf Text4 < 0 Or Text4 > 100 ThenMsgBox "分数不正确,请重新输入"GoTo dEnd IfElseMsgBox "请输入分数!"GoTo dEnd Ife: Text5 = Trim(InputBox("请输入科目2分数(0-100)", "科目2"))If IsNumeric(Text5) And Text5 <> "" ThenIf Text4 < 0 Or Text4 > 100 ThenMsgBox "分数不正确,请重新输入"GoTo eEnd IfElseMsgBox "请输入分数!"GoTo eEnd Iff: Text6 = Trim(InputBox("请输入科目3分数(0-100)", "科目3"))If IsNumeric(Text6) And Text6 <> "" ThenIf Text6 < 0 Or Text6 > 100 ThenMsgBox "分数不正确,请重新输入"GoTo fEnd IfElseMsgBox "请输入分数!"GoTo fEnd I fText7 = Val(Text4) + Val(Text5) + Val(Text6) '总分Text8 = Val(Text7) / 3 '平均分End Sub