Originally Posted by
Paul_Hossler
I try to avoid hard coding things is there's another way
Someome might wonder where the 'Magic Number' 1048576 came from
Sub Select1()
With ActiveCell.Parent
Range(ActiveCell, .Cells(.Rows.Count, ActiveCell.Column).End(xlUp)).Select
End With
End Sub
Hey Paul,
That's was exactly what I was looking for!
Thank you very much!
This will make my work so much easier again!
However, maybe a small question/adaptation.
What if another column in the sheet has data in a row that is beyond (greater number) than the one of the current one?
How would the formula look then?Range(ActiveCell, .Cells(.Rows.Count, ActiveCell.Column).End(xlUp)).Select
I guess ActiveCell.Column should then be replaced by the 'longest' column?
or in other words:
the range should be from the ActiveCell down to the lowest used row in the sheet.
Did I state this clear?
Someone might wonder where the 'Magic Number' 1048576 came from...
Do you really wonder? For your info:
Excel2007 and higher support (2^20 = 1048576) rows and (2^14 = 16384, FXD) columns