小编use*_*591的帖子

下一步没有错误VBA

我有以下代码,当我肯定有两个时,VBA给我一个"Next Without For"错误.我知道VBA可以列出与它们所说的不完全相同的错误,但我找不到任何其他闭环.如果有人可以检查出来,那就太棒了!谢谢:

Option Explicit
Sub HW09()

    Dim ng As Integer
    Dim v As String
    Dim lg As String
    Dim ca As Integer
    Dim sd As Integer
    Dim c As Integer
    Dim r As Integer

    c = 2

    Do
        ng = InputBox("Please enter the student's numerical grade.")
        If ng < 0 Then
            ng = 0
        If ng > 100 Then
            ng = 100
        End If

        Cells(c, 2).Value (ng)
        c = c + 1

        v = InputBox("Would you like to enter …
Run Code Online (Sandbox Code Playgroud)

excel vba for-loop

7
推荐指数
3
解决办法
6万
查看次数

标签 统计

excel ×1

for-loop ×1

vba ×1