我有一个引用excel中的表的数组。有没有办法让数组范围在刷新时自动适应表的大小?对于推荐我的代码如下。
AccessArray = Worksheets("AccessExport").Range("A1:BD5000").Value
UwatArray = Worksheets("UWAT").Range("A1:DZ20000").Value
For i = 2 To UBound(AccessArray, 1)
For Z = 2 To UBound(UwatArray, 1)
If AccessArray.Cells(i, 4) = UwatArray.Cells(Z, 1) And UwatArray.Cells(Z, 9) = "Deactivated" Or UwatArray.Cells(Z, 9) = "Does Not Meet UT Definition" Then
Rows(i).delete
Exit For
End If
Next Z
Next i
End Sub