Link to home
Start Free TrialLog in
Avatar of willie108
willie108

asked on

select a set of data in a column

Hi folks. I want to select a range of cells that are in a column. I remember that there is a good way to do this in such a way that if there are some missing data in some cells, that I can still capture the whole set of data. What I have would not do that. Can someone tell me a good way?
    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Range("A1").Select

Open in new window

Avatar of Steve
Steve
Flag of United Kingdom of Great Britain and Northern Ireland image

This one liner should select all of the data in coumn A from A1 to the last row of Data.

Range("A1", "A" & Range("A" & Rows.Count).End(xlUp).Row).Select

Open in new window

SOLUTION
Avatar of Steve
Steve
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of willie108
willie108

ASKER

Thanks. So would this be the recommended way to get to the cell just below that?
    Range("A1").Select
    Range("A1", "A" & Range("A" & Rows.Count).End(xlUp).Row).Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Range("A1").Select

Open in new window

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks!