判断最后一列的函数
Function LastColumn() As Long
Dim ix As Long
ix = ActiveSheet.UsedRange.Column – 1 + ActiveSheet.UsedRange.Columns.Count
LastColumn = ix
End Function
判断最后一行的函数
Function LastRow() As Long
Dim ix As Long
ix = ActiveSheet.UsedRange.Row – 1 + ActiveSheet.UsedRange.Rows.Count
LastRow = ix
End Function