问题描述
我有一个Excel中的VBA宏已经运行了一段时间。我已经在改变这些循环已经工作,突然代码没有编译:我已经尝试改为Do While ... Loop循环,但是我得到了相当的
这是我的代码的结构:
'这个循环很好
虽然'(代码用于评估)
'代码以循环运行
(w)
虽然'(更多的eval代码)
'代码
虽然'(eval代码)
'代码
Wend'< - 是编译错误发生的地方
'code
虽然'(eval代码)
'代码
Wend
'代码
Wend
有谁有任何想法可能是什么问题? (奖金:代码的缩进实际上是否重要?)
此消息通常没有表示未终止的 IF
某处可能会出现 IF ,而不匹配 End If
(这种错误消息有点恼人,因为它隐藏了真正的错误)
I have a VBA macro in excel that has run fine for a while. I've been making changes with these loops already working and suddenly the code is not compiling:
I have tried changing to Do While...Loop loops, but I got the equivalent
Here is the structure of my code:
'This loop is fine
While '(code for evaluation)
'code to run in loop
Wend
While '(more eval code)
'code
While '(eval code)
'code
Wend '<--This is where the compile error occurs
'code
While '(eval code)
'code
Wend
'code
Wend
Does anyone have any idea what could be the issue? (Bonus: Does the indentation of code actually matter?)
This message Wend without While usually indicates an un-terminated IF
Somewhere there may be an IF without the matching End If
(This kind of error message is a bit annoying since it hides the true error)
这篇关于VBA编译错误'没有'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!