Need help in data copying.

  • Thread starter Thread starter SMILE
  • Start date Start date
S

SMILE

Hi Dave

Thanks for your reply.
It is working perfect *if there is more than one row*.

But If I have the data only one row (B8 in my case) , then it selec
the data till the end of the file ( till Row no. 65536)

I will appreciate your reply.
Tom
 
SMILE,

Don't use .End(xlDown)

For example, if the code is

Range(ActiveCell, ActiveCell.End(xlDown)).Select

Change it to

Range(ActiveCell, Cells(65536, ActiveCell.Column).End(xlUp)).Select

HTH,
Bernie
MS Excel MVP
 
I'd change this portion:
With InvWks
.Range("b8", .Range("b8").End(xlDown)).Resize(, 5).Copy
End With
to
With InvWks
.Range("b8", .cells(.rows.count,"B").End(xlup)).Resize(, 5).Copy
End With

But that does assume you have something in B8.
 

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

Back
Top