Copy from one sheet in a workbook to another sheet in another work

G

Guest

Hi Again,

My last post didn't help.
I'm trying to copy (in VBA) all the data in one sheet to another sheet that
is in another workbook.

Right now, I use cell references and I always have to hit the update key and
I never know how many rows I need to reference. It would be easier to have
some VBA copy the entire sheet.


I was given " Workbooks("Book1").Sheets("Sheet1").Copy
Before:=Workbooks("Book2").Sheets(1)", but I got "Script out of range"

Do I have to open the workbook?
Both workbooks are in the same folder.

Thanks!
 
M

mpeplow

Yes you need to have the workbooks open or tell the macro to do it for
you by using the following code

workbooks.open ("Filename")
 

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