Home |
Search |
Today's Posts |
#1
|
|||
|
|||
copy and paste using code from workbook to workbook
how do i copy and paste from a template new workbook with a name say reports
and then from that template is called another workbook which says reports1 and so on till say 10.The workbook i am trying to copy to will be open the same time as the template new workbook report number either 1 to 10 whatever i need.Using a macro if possible -- BD3 |
#2
|
|||
|
|||
Don't worry about the name of the workbook
use object variables.. dim wbSource as workbook dim wbTarget as workbook set wbSource = workbooks.open("myWorkbook.xls") Set wbTarget = workbooks.add("myTemplate.xlt") you can then put a loop around creating new workbooks, etc. the Open method will open a specific workbook Add will open a new workbook based on the template you supply (but a different file) Sooo, try those out. "bigdaddy3" wrote: how do i copy and paste from a template new workbook with a name say reports and then from that template is called another workbook which says reports1 and so on till say 10.The workbook i am trying to copy to will be open the same time as the template new workbook report number either 1 to 10 whatever i need.Using a macro if possible -- BD3 |
#3
|
|||
|
|||
Hi Tom
sorry i dont quite understand a--where would you put the code and b i might not have explained properly the name of the workbooks i will be copying from will have all different names but the one i want to copy to will be an invoice workbook taken from an invoice template so the code would have to be on the original invoice template and to be able to cope with any name automatically does that make more sense -- BD3 "TomHinkle" wrote: Don't worry about the name of the workbook use object variables.. dim wbSource as workbook dim wbTarget as workbook set wbSource = workbooks.open("myWorkbook.xls") Set wbTarget = workbooks.add("myTemplate.xlt") you can then put a loop around creating new workbooks, etc. the Open method will open a specific workbook Add will open a new workbook based on the template you supply (but a different file) Sooo, try those out. "bigdaddy3" wrote: how do i copy and paste from a template new workbook with a name say reports and then from that template is called another workbook which says reports1 and so on till say 10.The workbook i am trying to copy to will be open the same time as the template new workbook report number either 1 to 10 whatever i need.Using a macro if possible -- BD3 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't Copy and Paste or Paste Special between Excel Workbooks | Excel Discussion (Misc queries) | |||
paste formulas between workbooks without workbook link | Excel Discussion (Misc queries) | |||
Copy and paste from 1 workbook to another | Excel Worksheet Functions | |||
I cannot paste from one workbook to another. Copy works, paste do. | Excel Discussion (Misc queries) | |||
Can't Copy and Paste between Excel 2003 Workbooks | Excel Discussion (Misc queries) |