compared all possibilities with a long test sheet:
0,140625 sec for
lastrow = calcws.Cells.Find("*", [A1], , , xlByColumns, xlPrevious).row
0 sec for
iLastRow = calcws.Cells(rows.count, "a").End(xlUp).row
and
numofrows = calcws.Cells.SpecialCells(xlLastCell).row
0,0078125 sec for
lastrow = calcws.UsedRange.rows.count
Do While 1
If calcws.Cells(lastrow, 1).Value = "" Then
lastrow = lastrow - 1
Else
Exit Do
End If
Loop
I think the favourites are obvious...
时间: 2024-08-04 06:05:43