(资料图)
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请采纳。
本文到此分享完毕,希望对大家有所帮助。
关键词: