XlDown: Go to next blank row

G

Guest

Can anyone tell me what would be the best method to use if I intend to use a
program that copies data from various worksheets and pastes the data to one
worksheet?

The data is copied and pasted consecutively based on a date range such as
(08/01/05 thru 08/10/05) etc. from different workbooks. Each workbook has
data specific to the date.

Currently:
The problem that I have is that I am using a macro that uses: 'XlDown' to
paste the data. This is because there is already existing data in the
worksheet... and I intend to paste the data to the next blank row.

What happens with XlDown is that it only takes me to the last row with
data... but I need to go to the next blank row so that I can paste the new
info.
 
G

Guest

You are better to use xlUp something like this

dim rng as range

set rng = sheets("Sheet1").Range("A65536").end(xlUp).offset(1,0)

You can paste right to the range something like

Sheets("Sheet2").Range("5:10").copy Destination :=rng
 

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