+ Reply to Thread
Results 1 to 5 of 5

Copy data from one file to an other file

  1. #1
    Registered User
    Join Date
    12-30-2017
    Location
    Luxembourg
    MS-Off Ver
    2016
    Posts
    33

    Copy data from one file to an other file

    Hello,

    I have to copy 120 sheets per month for some months from one WB to a second one. The shape of the area is the same: F5:AC66.

    At first glance the operation may seems useless, but it is necessary due to a new system of calculation and it seems the best choice to me to copy the data from the sheets with the ancient formulas to the sheets with the new formulas.
    Beside the action of copying the macro has also to create a sheet in the destination WB for every sheet in the source WB that doesn't exist yet and to put the name of the sheet into the cell U1 of every sheet.
    There are 3 sheets that don't have to be copied: DoNotCopy 1 to 3.
    How should the code look like which could do the required performance?
    Kind regards

    AmicusA
    Attached Files Attached Files
    Last edited by AmicusA; 01-17-2018 at 06:11 PM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Copy data from one file to an other file

    Place this macro in a regular module in the source workbook. Make sure both files are open and run the macro. We may have to make some minor changes to it to get exactly what you want.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    12-30-2017
    Location
    Luxembourg
    MS-Off Ver
    2016
    Posts
    33

    Re: Copy data from one file to an other file

    Hi,

    Thank you very much for the code.
    It works fine, but at the end I still have the data with the ancient formulas, whereas the purpose of the whole operation is to get the data into new destination sheets based on the Modelsheet with the new formulas.
    The macro would be better settled in a third WB, like that one attached. In the real third WB that contains the macros I have a sheet "Switch" with a lot of buttons.
    Kind regards
    AmicusApis
    Attached Files Attached Files
    Last edited by AmicusA; 01-19-2018 at 04:38 AM.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Copy data from one file to an other file

    Putting the macro in another workbook is not a problem. When you say "ancient formulas" and "new formulas" I don't really know what you are referring to. I don't see any formulas in either workbook. Please clarify in detail.

  5. #5
    Registered User
    Join Date
    12-30-2017
    Location
    Luxembourg
    MS-Off Ver
    2016
    Posts
    33

    Re: Copy data from one file to an other file

    Hi,

    As the formulas don't matter here because they stay untouched during the copying process, for the purpose of the example, as an illustration, I have merged the cells of the whole formula area and named it "Actual formulas" and "New formulas".
    What more is, in reality the macro could push the things a little bit farther and treat all the files it finds in a folder named "ToBeCopied": open every WB one after the other, copy the data to the "Destination" WB, by creating copies of the model sheet, and at the end save it under the same name as the source file, adding "new" at the and of the name.

    Regards
    AmicusA

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copy the data from Master file and paste into individual excel file as per criteria
    By Vikas_k in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-30-2023, 09:15 AM
  2. Macro to copy fresh data from master file n paste to destntion file
    By awl0111 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-13-2017, 02:56 AM
  3. Replies: 1
    Last Post: 07-11-2015, 01:04 AM
  4. Require help in modifying the code to copy data to an existing file instead of new file
    By ahamedcader in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2014, 02:57 PM
  5. Replies: 3
    Last Post: 05-21-2013, 08:22 AM
  6. [SOLVED] open variably named file, copy/paste data into consolidation file, open next file in list
    By sllawrence1968 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 09:49 PM
  7. [SOLVED] Macro to copy file names and data from each file in a folder into master spreadsheet
    By dee1989 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-10-2012, 05:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1