我正在尝试清除从单元格 M22 开始使用并转到最后一列的动态范围,但最后一列的使用让我望而却步。
谢谢
Sub clear()
Workbooks.Open Filename:=ThisWorkbook.path & "\..\Master Info Page.xlsx"
With Sheets("Sheet1")
lastCol = .Cells(13, .Columns.Count).End(xlToLeft).Column
Lastrow = .Cells(.Rows.Count, lastCol).End(xlUp).Row
End With
Sheets("Sheet1").Range(Cells(M22, 13), Cells(Lastrow, lastCol)).Clear
End Sub