Copying Between Workbooks with Varying Names

  • I am attempting to copy/paste values from one open workbook to another.

    Neither of the workbooks will have static names, so there will be no name consistency.

    Both of my workbooks will be open and will be the only open files.


    My sample files only have one sheet, but the actual files will have multiple corresponding sheets.

    I'd just like to be on matching worksheets in each workbook, and have the macro copy the information from one workbook to the other.

    I would then switch to the next set of matching worksheets and run it again.


    I cannot have the macro run on all the sheets, as only some sheets in each file will need to be updated to the new template.


    Any help would be appreciated on getting the following code to work.



    Sample files attached.

  • Hello and Welcome to the Forum :)


    A simple trick is to have your macro in the ' old template ' file ...


    This macro will define two workbook variables e.g. wkb1 As the Active Workbook and wkb2 As the Workbook to be opened ...


    Then, it is only a matter of copying between your two opened workbooks ...while avoiding the Select instruction ...;)


    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Here's the dilemma: I have thousands of 'old template' files that need to be updated to 'new template' files.


    Every 'old template' and 'new template' file is already existing (with no name consistency).


    The attached were just renamed for simplicity for this question.

  • Hello,


    When it comes to thousands ans thousands of files ... you should take a look at Power Quey


    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)