Selecting cells

R

Rick

I have a block of data cells from AS3 to AS14 which I
sort. As a result of the sort I am left with some rows of
data and some rows of blank cells. After the sort, the
blank cells appear first and then the cells with data. I
wish to select only the data cells which I then paste
elsewhere. The data cells obviously appear at the bottom
of my cell range. Could any one assist with a macro to
only select the data cells.
Thanks,
Rick
 
D

Dick Kusleika

Rick

When I sort, the blanks appear at the bottom. How are you sorting to get
them at the top?

To get the data cells, you might try this

Dim Rng As Range

Set Rng = Range("AS3:AS13")

Range(Rng.Cells(1).End(xlDown), _
Rng.Cells(1).End(xlDown).End(xlDown)).Select
 
D

Dan

You might try using the "Auto Filter" first to filter out
the blank rows, paste it then sort from there. That may
be difficult to do if one of the columns does not contain
a common property in the 14 rows of data you are going to
sort.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top