Selecting a column
Selecting a column
(OP)
I have a fairly simple problem, I think...
I have a sheet containing 10 different columns. In a macro, I specify it to look for a "project manager" which is the title of the column. When it finds it, I want it to select the entire column and delete it, shifting everything to the left.
The problem is that when it says range(selection, selection.end(xldown)) --- it only goes to the first blank cell, but doesn't go to the very end of the column. I know the size of my column (say 26 rows), so how do I specify it to highlight from Project manager to the 26th row, without specifying if its "A26" or "B26"?
I have a sheet containing 10 different columns. In a macro, I specify it to look for a "project manager" which is the title of the column. When it finds it, I want it to select the entire column and delete it, shifting everything to the left.
The problem is that when it says range(selection, selection.end(xldown)) --- it only goes to the first blank cell, but doesn't go to the very end of the column. I know the size of my column (say 26 rows), so how do I specify it to highlight from Project manager to the 26th row, without specifying if its "A26" or "B26"?





RE: Selecting a column
Do you want to select the whole column or not, if so use this
Sub select_column()
Selection.EntireColumn.Select
Range(Selection, Selection.End(xlToLeft)).Select
End Sub
However, to select rows used only try this code
Sub select_column()
Range("C1").Select
MY_CELL = ActiveCell.Column
Range(Selection, Range("A65536").Offset(0, MY_CELL - 1).End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
End Sub
Either of theses any use?
----------------------------------
Hope this helps.
----------------------------------
maybe only a drafter
but the best user at this company!