This is also related to below queries:
- columns.count vba
- select last row vba
- excel vba last used column
- vba find last row with data
- excel vba find last row with data in range
The code:
''' Select last column
Range("A1").Select
Selection.End(xlToRight).Select
Range(ActiveCell, ActiveCell.Offset(0, 0)).EntireColumn.Select
''' Select last 2 columns
Range("A1").Select
Selection.End(xlToRight).Select
Range(ActiveCell, ActiveCell.Offset(0, -1)).EntireColumn.Select
''' Select last 3 columns
Range("A1").Select
Selection.End(xlToRight).Select
Range(ActiveCell, ActiveCell.Offset(0, -2)).EntireColumn.Select
No comments:
Post a Comment