Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 为什么它说没有for循环?_Excel_Vba - Fatal编程技术网

Excel 为什么它说没有for循环?

Excel 为什么它说没有for循环?,excel,vba,Excel,Vba,我不确定为什么当我尝试输入下一行2时,这表示没有for循环 Sub test4() For row2 = 2 To 174 If IsEmpty("I" & row2) Then Worksheets("Sheet1").Range("I" & row2).Copy _ Destination:=Worksheets("Sheet2").Range("R5") If IsEmpty("I" &

我不确定为什么当我尝试输入下一行2时,这表示没有for循环

Sub test4()
    For row2 = 2 To 174
        If IsEmpty("I" & row2) Then
            Worksheets("Sheet1").Range("I" & row2).Copy _
            Destination:=Worksheets("Sheet2").Range("R5")
    If IsEmpty("I" & row2) Then Exit For
    Next row2
End Sub

如果某个地方缺少一个如果某个地方缺少一个结束,则缺少一个结束