廊坊新闻网-主流媒体,廊坊城市门户

运行时错误9下标越界怎么办_运行时错误9下标越界

2023-06-03 16:44:44 来源:互联网


(资料图)

1、可能是单元格的文本没有那么多行,超过了。

2、修改为,如果调用时的参数Line超过了单元格的文本行数,则返回空的字符串。

3、Function GetCellTextLine(i As Integer, j As Integer, Line As Integer) Dim S$, V S = Cells(i, j).Text V = Split(S, Chr(10)) If Line > UBound(V) + 1 Then GetCellTextLine = "" Else GetCellTextLine = V(Line - 1) End IfEnd Function请采纳。

本文到此分享完毕,希望对大家有所帮助。

关键词: