我希望能够在不使用UsedRange
的情况下快速找到非连续数据范围的最右列和最后一行。我没有找到比这种方法更快的方法。有什么想法吗?
Function Range_Find_Method(ws As Worksheet)
Dim lRow As Long
Dim lCol As Long
With ws
lRow = .Cells.Find(What:="*", _
After:=.Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
lCol = .Cells.Find(What:="*", _
After:=.Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Column
End With
Debug.Print lRow
Debug.Print lCol
end function
谢谢