Code :
Sub MyColumnSelect()
Dim myCurrentRow As Long
Dim myLastColumn As Long
myCurrentRow = ActiveCell.Row
myLastColumn = ActiveCell.SpecialCells(xlLastCell).Column
Range(ActiveCell, Cells(myCurrentRow, myLastColumn)).Select
End Sub
I need to extend my selection from any colum or any row to the last used column in the sheet. This code extends the selection to a particular column, in my case to column P
. I don't know why is this the case but even if there are only 4 columns, it still extends the selection to column P
.
PS: I know I shouldn't use select
, but I can't make it work even with select
. Need Help.