ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to copy and paste between two workbooks (https://www.excelbanter.com/excel-programming/328768-macro-copy-paste-between-two-workbooks.html)

Paula

Macro to copy and paste between two workbooks
 
I have a macro that copies specific cells between workbooks, but I have
several workbooks I'd like to use it with (different company information) and
each is named differently. Because the macro switches back and forth copying
and pasting it names the Specific Workbook to copy from or paste to. Can I
make it generic somehow so I can use the macro with any workbook without
having to rename my workbooks and rename them again when the macro has
finished running.

filo666

Macro to copy and paste between two workbooks
 
use the ActiveWorkbook.Next application and erase all the workbook names in
your code (ex. workbook( "aaaaaaaa.xls")), when you run the macro start from
the workbook you want to copy from an the macro will automatically switch to
the next opened workbook and paste all what hes has previusly copied.
HTH
PD. Remember just to have tow workbooks opened

"Paula" wrote:

I have a macro that copies specific cells between workbooks, but I have
several workbooks I'd like to use it with (different company information) and
each is named differently. Because the macro switches back and forth copying
and pasting it names the Specific Workbook to copy from or paste to. Can I
make it generic somehow so I can use the macro with any workbook without
having to rename my workbooks and rename them again when the macro has
finished running.



All times are GMT +1. The time now is 01:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com