在Excel VBA中尝试将子语句拆分为多行

在Excel VBA中尝试将子语句拆分为多行,vba,Vba,我试图写一个sub语句,它从另一个调用它的sub语句接收多个参数(抱歉,我在这方面很新,所以我的术语可能不正确) 我传递的参数数量相当多,因此它超出了我的屏幕范围。为了便于阅读,我想将参数列表拆分为多行。我尝试过使用“空格下划线”技巧,就像您在子部分中使用的那样。但是,当我这样做时,VBA会停止将子识别为它自己的例程 你知道我该怎么做吗 例如,这项工作: ... End Sub ' from previous subroutine Sub openfile(ByVal Res, ByVal

我试图写一个sub语句,它从另一个调用它的sub语句接收多个参数(抱歉,我在这方面很新,所以我的术语可能不正确)

我传递的参数数量相当多,因此它超出了我的屏幕范围。为了便于阅读,我想将参数列表拆分为多行。我尝试过使用“空格下划线”技巧,就像您在
子部分中使用的那样。但是,当我这样做时,VBA会停止将
识别为它自己的例程

你知道我该怎么做吗

例如,这项工作:

... 
End Sub ' from previous subroutine

Sub openfile(ByVal Res, ByVal Book, ByVal inp) 'there are other arguments as well, but I have shortened them for convenience here. 

....

End Sub
但这并不是:

... 
End sub ' from previous subroutine

Sub openfile(ByVal Res, ByVal Book, _

ByVal inp) 'there are other arguments as well, but I have shortened them for convenience here. 

....

End Sub

\uu
和代码的下一部分之间不能有一个完全的空行(空行)。去掉多余的线,你就没事了。基本上,这样做:

Sub openfile(ByVal Res, ByVal Book, _
ByVal inp) 'there are other arguments as well, but I have shortened them for convenience here.
如果你真的想有一个几乎空白的行,你可以这样做:

Sub openfile(ByVal Res, ByVal Book, _
 _
ByVal inp) 'there are other arguments as well, but I have shortened them for convenience here.
请注意,位于其自身行上的
前面必须有一个空格字符;这很重要