【发布时间】:2016-07-02 12:21:14
【问题描述】:
我在 VBA 中编写了一个代码,用于获取 excel 中数据数组的最后一个边界。我假设数组以单元格“A1”开头:
Function getBoundary()
Dim boundaryPoint(2)
boundaryPoint(0) = Cells(Rows.Count, 1).End(xlUp).Row
boundaryPoint(1) = Cells(1, Columns.Count).End(xlToLeft).Column
getBoundary = boundaryPoint
结束函数
我想知道是否有更好的方法,以及我的代码是否经过优化。
【问题讨论】: