Results 1 to 9 of 9

How to copy data from multiple workbook from multiple subfolder

Threaded View

  1. #1
    Registered User
    Join Date
    08-01-2020
    Location
    Viet nam
    MS-Off Ver
    2007, 2010
    Posts
    17

    How to copy data from multiple workbook from multiple subfolder

    Hi all

    I have work book Total.xlsm with sheets(Main, A001, B002, C003, D004,E005,F006)
    Total.xlsm is the same path with alot of folders: 202006,202005,202004,202003,......201912,20201911,201910,...etc (Folder have name like yyyymm)

    Now I want to have macro to do this:
    1. Check each Folder name with range("A2: lastrow)
    2. If meet folder.name will check 4 characters of each excel name with: Left(excel_filename,4) = Range("B2:lastrow")
    3. If Filename exist will copy data to Total.xlsm like:
    Left(excel_filename,4) = "A001" then copy data to workbook("total").sheets("A001").Range("A1")
    Left(excel_filename,4) = "B002" then copy data to workbook("total").sheets("B002").Range("A1")
    Left(excel_filename,4) = "C003" then copy data to workbook("total").sheets("C003").Range("A1")
    Left(excel_filename,4) = "D004" then copy data to workbook("total").sheets("D004").Range("A1")
    Left(excel_filename,4) = "E005" then copy data to workbook("total").sheets("E005").Range("A1")
    Left(excel_filename,4) = "F006" then copy data to workbook("total").sheets("F006").Range("A1")

    Please help me./.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy data from multiple WorkBook structures to the same sheet on another workbook
    By tax112 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-16-2018, 09:43 AM
  2. Copy the Data from Multiple workbook to Master Workbook as Conslidated
    By venugosr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-19-2017, 01:32 AM
  3. Replies: 2
    Last Post: 01-22-2016, 08:03 PM
  4. Replies: 0
    Last Post: 09-18-2015, 03:20 AM
  5. Replies: 9
    Last Post: 02-13-2015, 05:12 AM
  6. Replies: 12
    Last Post: 07-29-2014, 01:06 PM
  7. Copy data from multiple sheet in multiple books into a new summary workbook
    By dobba in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2014, 08:14 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