PDA

View Full Version : VBA script to copy workbook contents



baron11
07-22-2008, 10:22 AM
how to copy contents of workbook 1 to workbook 2 ?

RonMcK
07-22-2008, 10:34 AM
Malcolm posted the following snippet the other day:
Sub macro1()
Workbooks.Open Filename:="your source file.xls"
ActiveWorkbook.SaveAs "C:\your target file.xls"
End Sub

This should take care of the job for you.

HTH,

baron11
07-22-2008, 10:54 AM
Thanks a lot Ron.

mdmackillop
07-22-2008, 10:56 AM
but if you want to stay in the original workbook
Sub macro1()
Workbooks.Open Filename:="your source file.xls"
ActiveWorkbook.SaveCopyAs "C:\your target file.xls"
End Sub