作者:壹花壹浄土 | 来源:互联网 | 2023-05-18 16:57
Iamtryingtocontinuetheforloopintheifconditionbelow,butVBAcomplainscompileerror:Ne
I am trying to continue the for loop in the if condition below, but VBA complains compile error: "Next without For".
I am using "GoTo", because there is no "continue" keyword in VBA, such as other typical programming languages.
我试图在下面的if条件中继续for循环,但是VBA抱怨编译错误:“Next without For”。我正在使用“GoTo”,因为VBA中没有“continue”关键字,例如其他典型的编程语言。
Any idea what is wrong here?
知道这里有什么问题吗?
For RowIndex = 2 To lastrow
If Worksheets("Sheet1").Range("$b$" & RowIndex) = "" Then
GoTo EndLoop
output_string = setproperty & Worksheets("Sheet1").Range("$b$" & RowIndex) & " [ get_ports " & """" & Worksheets("Sheet1").Range("$g$" & RowIndex) & """" & " ]"
Print #1, output_string
output_string = setpropertyiostandard & Worksheets("Sheet1").Range("$k$" & RowIndex) & " [ get_ports """ & Worksheets("Sheet1").Range("$g$" & RowIndex) & """" & " ]"
Print #1, output_string
If Worksheets("Sheet1").Range("$k$" & RowIndex) = "LVCMOS18" Then
'Debug.Print "found" & RowIndex
output_string = "set_property DRIVE 8 [ get_ports " & Worksheets("Sheet1").Range("$g$" & RowIndex) & "]"
Print #1, output_string
End If
EndLoop:
Next RowIndex
2 个解决方案