+ Reply to Thread
Results 1 to 7 of 7

Macro that copy/pastes from multiple workbooks to one workbook

  1. #1
    Registered User
    Join Date
    09-27-2019
    Location
    south carolina
    MS-Off Ver
    mircosoft office 365 excel
    Posts
    19

    Macro that copy/pastes from multiple workbooks to one workbook

    All files are already open. I need a macro to copy and paste the data only.

    workbook named "ALL data.xlsm" - main file that holds macro. all data from individual files below need to be pasted here. Column A will be a formula. New data from files listed below will be pasted into column B. Append do not copy over each other.

    workbook named "AND.xlsx" - data file will change daily
    workbook named "BAJ.xlsx" - data file will change daily
    workbook named "FOS.xlsx" - data file will change daily. i have several more this is just a sample list of file names

    copy from each individual file AND all data in file, paste into ALL data.xlsm file into column B

    STEP example:
    go to file AND.xlsx select all data from A2:N
    go to file ALL data.xlsm paste in column B
    go to file BAJ.xlsx select all data from A2:N
    go to file ALL data.xlsm paste in column B below the data from file AND
    go to file FOX.xlsx select all data from A2:N
    go to file ALL data.xlsm paste in column B below the data from file BAJ
    Attached Files Attached Files
    Last edited by conjohn562; 01-12-2021 at 05:51 PM. Reason: provide more info and files

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Macro that copy/pastes from multiple workbooks to one workbook

    You should be consistent with your file names and what you upload for sample files. The code uses the names of the uploaded files, but you can change those to the actual file names.

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    09-27-2019
    Location
    south carolina
    MS-Off Ver
    mircosoft office 365 excel
    Posts
    19

    Re: Macro that copy/pastes from multiple workbooks to one workbook

    thank you this worked great. I know code well enough to add additional files. However, it is pasting the values into the main file in column A...i need it to be B. I tried a few things and it didn't work. Can you help me with the code to paste into column B instead of A in the ALL BUs file? If not, I can run a macro to move the values over a column.

  4. #4
    Registered User
    Join Date
    09-27-2019
    Location
    south carolina
    MS-Off Ver
    mircosoft office 365 excel
    Posts
    19

    Re: Macro that copy/pastes from multiple workbooks to one workbook

    never mind I found what I needed to fix. I changed the (rows.count, 1) to (rows.count, 2) YEAH!!!!

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Macro that copy/pastes from multiple workbooks to one workbook

    Yep, oversight on my part. Here is amended code.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-27-2019
    Location
    south carolina
    MS-Off Ver
    mircosoft office 365 excel
    Posts
    19

    Re: Macro that copy/pastes from multiple workbooks to one workbook

    SUPER! thanks!

  7. #7
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Macro that copy/pastes from multiple workbooks to one workbook

    Quote Originally Posted by conjohn562 View Post
    SUPER! thanks!
    You're welcome,
    Regards, JLG

+ 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. Macro to copy formulas from multiple workbooks into new workbook (paste text of formula)
    By robertsfd2002 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2014, 12:46 PM
  2. Replies: 4
    Last Post: 08-19-2014, 02:42 PM
  3. Replies: 1
    Last Post: 10-03-2012, 07:06 PM
  4. Replies: 2
    Last Post: 09-05-2012, 03:20 PM
  5. [SOLVED] Macro To Copy Specific cells From Multiple Workbooks to New Summary Workbook
    By Mooseman60 in forum Excel Programming / VBA / Macros
    Replies: 36
    Last Post: 06-19-2012, 07:38 AM
  6. macro to copy data from multiple workbooks in a single workbook
    By blyzzard in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2011, 05:34 AM
  7. macro to copy data from multiple workbooks to database workbook
    By jarssonn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2010, 09:07 PM

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