View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
scott scott is offline
external usenet poster
 
Posts: 577
Default Macro to Copy From One Workbook To Another

Hi,
Yes it is possible, you just need to put it in the open event of the second
book. You could either have the user choose the file (from a file picker) or
have it hard coded in if you are always going to use the same file. As for
coding you could use something along the lines

dim wks as worksheet
dim i as integer
i=1
for each wks in "insert workbook name".worksheets
wks.cells.copy
'insert original workbook name'.sheets(i).range("A1").pastespecial
xlpastevalues
i=i+1
next wks

basically that will copy each worksheets cells into sheets (i) of your new
book. I just wrote this off the top of my head to give you an idea of what
to do. It's possible there are some compiling mistakes, since I don't work
between workbooks on a daily basis. If you need more help I could give you a
better defined macro which should do the trick.

cheers,

Scott
" wrote:

I have two workbooks. I want to create a macro that copies information from
one workbook, which will be closed, to another workbook, which will be open.
I would also prefer if this macro could run everytime the second workbook is
opened. Is this possible?

I would appreciate any help,

Adam Bush