|
发表于 2011-8-28 08:23
|
显示全部楼层
本楼为最佳答案
本帖最后由 zjdh 于 2011-8-28 08:25 编辑
- Sub 保存提交()
- Dim xh, xm, cj%, i, a
- Dim bzda, xsda()
- With Sheets(Right(ActiveSheet.Name, 2) & "答案")
- bzda = .Range("b3:b" & .[b65536].End(3).Row)
- End With
- ReDim xsda(1 To UBound(bzda))
- xh = [b2]
- xm = [d2]
- For Each icell In Range("l4:l" & [l65536].End(3).Row) '假定每题都要求必答
- If i > UBound(bzda) Then Exit For
- If icell <> "" Then i = i + 1: xsda(i) = UCase(icell)
- Next
- For i = 1 To UBound(bzda)
- If xsda(i) = bzda(i, 1) Then cj = cj + 2
- Next i
- [h2] = cj
- With Sheets("学生考试信息登记表")
- Set a = .Range("a1:a65536").Find(xh, lookat:=xlWhole)
- .Cells(a.Row, 5) = cj
- .Cells(a.Row, 6) = "已考"
- End With
- Application.Visible = False
- UserForm1.TextXH = [b2]
- UserForm1.TextXM = [d2]
- UserForm1.Show
- End Sub
复制代码 |
|