Sub LastUsedColumn_SpecialCells_1()
Dim lastColumn As Integer
lastColumn = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Column
MsgBox lastColumn
End Sub
Sub LastUsedColumn_SpecialCells_2()
Dim lastColumn As Integer
lastColumn = ActiveSheet.Range("A1").SpecialCells(xlCellTypeLastCell).Column
MsgBox lastColumn
End Sub
No comments:
Post a Comment