📜  excel vba 范围内的最后一行 - VBA 代码示例

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

代码示例1
Dim rRange As Range
Dim rDuplicate As Range

Set rRange = ActiveSheet.UsedRange
lFirstRow = rRange.Row
lLastRow = rRange.Rows.Count + rRange.Row - 1
lFirstColumn = rRange.Column
lLastColumn = rRange.Columns.Count + rRange.Column - 1
' New reference to current range (can be resized / moved)
Set rDuplicate = Range(Cells(lFirstRow, lFirstColumn), _
      Cells(lLastRow, lLastColumn))