Select Case RS!lecode
                        Case 0
                            If Level0(i) > 0 Then
                                '检查本章试题是否已选够
                                For n = 0 To UBound(zj(n))
                                    If cmbChapter(i).AddItem(n) = RS!unit Then Exit For
                                Next
                                If Chapter(i, n) > 0 Then
                                    wo.Books("h2").Range.Text = " & j & "" 、"" & RS!stdes & " & vbCrLf
                                    j = j + 1
                                    Chapter(i, n) = Chapter(i, n) - 1
                                    Level0(i) = Level0(i) - 1
                                    Count(i) = Count(i) - 1
                                End If
                        Case 1   '<---case 提示没 select case
                            If Level1(i) > 0 Then
                                '检查本章试题是否已选够
                                For n = 0 To UBound(zj(n))
                                    If cmbChapter(i).AddItem(n) = RS!unit Then Exit For
                                Next
                                If Chapter(i, n) > 0 Then
                                    wo.Books("h2").Range.Text = " & j & "" 、"" & RS!stdes & " & vbCrLf
                                    j = j + 1
                                    Chapter(i, n) = Chapter(i, n) - 1
                                    Level1(i) = Level1(i) - 1
                                    Count(i) = Count(i) - 1
                                End If
                        Case 2
                            If Level2(i) > 0 Then
                                '检查本章试题是否已选够
                                For n = 0 To UBound(zj(n))
                                    If cmbChapter(i).AddItem(n) = RS!unit Then Exit For
                                Next
                                If Chapter(i, n) > 0 Then
                                    wo.Books("h2").Range.Text = " & j & ""、"" & RS!stdes & " & vbCrLf
                                    j = j + 1
                                    Chapter(i, n) = Chapter(i, n) - 1
                                    Level2(i) = Level2(i) - 1
                                    Count(i) = Count(i) - 1
                                End If
                    End Select

解决方案 »

  1.   

    case 0中少了个End If?
      

  2.   

    Case 0
        If Level0(i) > 0 Then
            '检查本章试题是否已选够
             For n = 0 To UBound(zj(n))
                If cmbChapter(i).AddItem(n) = RS!unit Then Exit For
            Next
            If Chapter(i, n) > 0 Then
                wo.Books("h2").Range.Text = " & j & "" 、"" & RS!stdes & " & vbCrLf
                j = j + 1
                Chapter(i, n) = Chapter(i, n) - 1
                Level0(i) = Level0(i) - 1
                Count(i) = Count(i) - 1
             End If
        end if 
    Case 1   '<---case 提示没 select case
      

  3.   

        Select Case RS!lecode
            Case 0
                If Level0(i) > 0 Then
                    '检查本章试题是否已选够
                    For n = 0 To UBound(zj(n))
                        If cmbChapter(i).AddItem(n) = RS!unit Then Exit For
                    Next
                    If Chapter(i, n) > 0 Then
                        wo.Books("h2").Range.Text = " & j & "" 、"" & RS!stdes & " & vbCrLf
                        j = j + 1
                        Chapter(i, n) = Chapter(i, n) - 1
                        Level0(i) = Level0(i) - 1
                        Count(i) = Count(i) - 1
                    End If
                End If
            Case 1   '<---case 提示没 select case
                If Level1(i) > 0 Then
                    '检查本章试题是否已选够
                    For n = 0 To UBound(zj(n))
                        If cmbChapter(i).AddItem(n) = RS!unit Then Exit For
                    Next
                    If Chapter(i, n) > 0 Then
                        wo.Books("h2").Range.Text = " & j & "" 、"" & RS!stdes & " & vbCrLf
                        j = j + 1
                        Chapter(i, n) = Chapter(i, n) - 1
                        Level1(i) = Level1(i) - 1
                        Count(i) = Count(i) - 1
                    End If
                End If
            Case 2
                If Level2(i) > 0 Then
                    '检查本章试题是否已选够
                    For n = 0 To UBound(zj(n))
                        If cmbChapter(i).AddItem(n) = RS!unit Then Exit For
                    Next
                    If Chapter(i, n) > 0 Then
                        wo.Books("h2").Range.Text = " & j & ""、"" & RS!stdes & " & vbCrLf
                        j = j + 1
                        Chapter(i, n) = Chapter(i, n) - 1
                        Level2(i) = Level2(i) - 1
                        Count(i) = Count(i) - 1
                    End If
                End If
        End Select
      

  4.   

                            Case 0
                                If Level0(i) > 0 Then
                                    '检查本章试题是否已选够
                                    For n = 0 To UBound(zj(n))
                                        If cmbChapter(i).AddItem(n) = RS!unit Then Exit For
                                    Next
                                    If Chapter(i, n) > 0 Then
                                        wo.Books("h2").Range.Text = " & j & "" 、"" & RS!stdes & " & vbCrLf
                                        j = j + 1
                                        Chapter(i, n) = Chapter(i, n) - 1
                                        Level0(i) = Level0(i) - 1
                                        Count(i) = Count(i) - 1
                                    End If
                            Case 1   '<---case 提示没 select case
     少了一个end if