下面的代码将一个范围加载到数组中:
Dim Data() As Variant
Dim i As Long
Erase Data
i = 2: Do Until Sheets("whatever").Cells(i, 1) = "": i = i + 1: Loop
Sheets("whatever").Activate
Data = Sheets("whatever").Range(Cells(2, 1), Cells(i, 37)).Value
这曾经有用,但从今天开始(新数据?)给了我运行时错误' 6' /加载Data
数组的行溢出。
i = 242703这确实是我要加载的最后一行。对阵列来说这可能是两个大的吗?