use*_*207 3 excel vba excel-vba excel-2016
我想知道在VBA中是否有相当于Python的pass语句.
我正在使用Excel 2016.
Yow*_*E3K 6
如果你正在寻找一些可以用来插入断点的"非语句",那么使用Stop(参见这个答案)似乎是最好的办法,因为该Stop命令会导致代码在到达时中断,即你甚至不需要将它标记为断点,因为它是一个断点.
Stop
您可能还想考虑使用Debug.Assert some_logical_expression,它会在逻辑表达式求值时自动中断False.所以Debug.Assert False相当于Stop,并且Debug.Assert x = 3相当于If x <> 3 Then Stop.
Debug.Assert some_logical_expression
False
Debug.Assert False
Debug.Assert x = 3
If x <> 3 Then Stop
Vit*_*ata 5
在 Python 中,您需要Pass,因为否则这些方法将不会运行。在 VBA 中,如果您保留一个空方法,如下所示:
Pass
Public Function Foo() As String() End Function
归档时间:
8 年,5 月 前
查看次数:
3268 次
最近记录: