For j = 0 to SpreadCount
If TypeName(ChainsDC(j,0) = "String" 'testing for an error
Goto EndLoop
Else:
For i = 0 to RscSct
...do amazing things here (no loops)
Next i
EndLoop:
Next j '<<<PROBLEM
Run Code Online (Sandbox Code Playgroud)
编译器抱怨下一个j(第9行)是"Next without For".
您的IF语句是问题所在.您需要添加一个Then和一个End If:
For j = 0 to SpreadCount
If TypeName(ChainsDC(j,0) = "String" **Then**
Goto EndLoop
Else:
For i = 0 to RscSct
...do amazing things here (no loops)
Next i
**End If**
EndLoop:
Next j '<<<PROBLEM
Run Code Online (Sandbox Code Playgroud)
编辑
您的Typename也缺少一个右括号.