Use the Selection.End(xlDown) method to select data in a column but do not stop at a blank space. PL

M

minkokiss

I am trying to select all the data in a column using this method but
when a blank cell is encountered the selection stops and everything
after the blank space is left out. Would you please let me know what I
am doing wrong. Here is an example of the code.


Cells(5, i).Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Copy
 
J

JE McGimpsey

You're doing nothing "wrong" - the Select Down command is designed to
stop at a blank cell.

Instead, try:

Range(Cells(6, i), Cells(Rows.Count, i).End(xlUp)).Copy _
Destination:=DestRange

Where DestRange is your destination cell.
 
G

Guest

to get to the last item in a column, say column A:

nrow=Cells(Rows.Count,"A").End(xlUp).Row
 
M

minkokiss

You're doing nothing "wrong" - the Select Down command is designed to
stop at a blank cell.

Instead, try:

Range(Cells(6, i), Cells(Rows.Count, i).End(xlUp)).Copy _
Destination:=DestRange

Where DestRange is your destination cell.

Thank you thank you. That worked perfectly. Thank you for all your
help

Minko
 

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