📜  带有数据的excel vba最后一列 - VBA代码示例

📅  最后修改于: 2022-03-11 14:51:53.840000             🧑  作者: Mango

代码示例2
Dim rLastCell As Range

Set rLastCell = ws.Cells.Find(What:="*", After:=ws.Cells(1, 1), _
    LookIn:=xlFormulas, LookAt:= xlPart, SearchOrder:=xlByColumns, _
    SearchDirection:=xlPrevious, MatchCase:=False)

MsgBox ("The last used column is: " & rLastCell.Column)