Copy to Next Blank Row of Different Workbook

J

JamesWilliams

Hello,

I'm new to VBA so I need some help with the following. I have a workin
workbook and I want to dump all of the data into a master workbook i
the next blank row. The working file will have a different number o
rows of data, so I need the range to select the data in the working fil
based on what is in there (the range will start at B4). I think I nee
xldown and right?!

I've searched for an answer before posting but none of the other thread
quite match what I need.

Thanks,

Jame
 
P

pascal baro

Hi

.... (the range will start at B4). I think I need
xldown and right?!
I would say that you'd better start from xldown towards xlup. Just because, if you go the other way round, if there is an empty cell in your range, this will be your last row and you just might half way to the last row...

example of xlup

dim lastr as long
lastr = sheet1.cells(rows.count, 2).end(xlup).row

the number 2 means column 2 or column B.

Pascal Baro
http://multiskillz.tekcities.com/
 

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