+ Reply to Thread
Results 1 to 28 of 28

Merge all file in folder.

  1. #1
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Merge all file in folder.

    I want merge all file in folder (.xls) But every file header as same.

    I want to create new file (merge all file) ---> create new file name = data.xlsx
    and delete file original before merge.

    Please guide me about it. (VBA , Macro)
    Last edited by adamasmay; 05-26-2022 at 12:14 AM.

  2. #2
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    Any Idea for solve this case?

  3. #3
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,381

    Re: Merge all file in folder.

    With power query

  4. #4
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    It can use macro write power query?

  5. #5
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,381

    Re: Merge all file in folder.

    You don't need macro's to use power query

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Merge all file in folder.

    Your Excel version being ? ( Profile indicates version 8??)

  7. #7
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    I want to solve this case via call macro, vba.

    Please guide me about it.

  8. #8
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,381

    Re: Merge all file in folder.

    It will be something like this then


    Please Login or Register  to view this content.

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Merge all file in folder.

    Quote Originally Posted by adamasmay View Post
    I want to solve this case via call macro, vba.

    Please guide me about it.
    We advise you not to 'bump' (reply to) your own posts too quickly after posting, unless you are posting some sort of clarification. Since bumped threads have replies, they will no longer appear in the "Zero Reply Posts" listing, which many members use to look for unanswered questions. If you do bump, limit it to no more than once every day. Remember that your best helper may be asleep on the other side of the world.

  10. #10
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    Anyone please guide me for solve this case.
    Attached Images Attached Images
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,381

    Re: Merge all file in folder.

    This should work, only for 3 columns.

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    After run with your code that you sugggest.

    My data have same header.
    I don't write same in file 2,3.
    and I want wwrite output in new file (Output.xlsx)

    Please guide me more about it.
    Attached Images Attached Images

  13. #13
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,381

    Re: Merge all file in folder.

    Predefine your header

    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    1. I want header in first row (highlight yellow)
    2. save data in newfile.
    3. delete file original.

    Please guide me more for solve it.
    Attached Images Attached Images
    Last edited by adamasmay; 05-26-2022 at 04:42 AM.

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Merge all file in folder.

    Place all workbooks incl. OutPut in the same folder.
    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    It good if I can paste output macro.

    It error as below.
    Attached Images Attached Images

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Merge all file in folder.

    See if this works,
    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    Data output as correct.
    But If I want delete file orginal and write data to new file.

    Please guide me more about it.

  19. #19
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Merge all file in folder.

    What is "Original" file?

  20. #20
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    I change your code as higlight.

    Origanal file mean file in folder that highlight.
    Attached Images Attached Images

  21. #21
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Merge all file in folder.

    No idea about what you are trying to say with that picture.

    That's just folder path, not the file.

  22. #22
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    Now I merge all file in folder as picture.
    After merge I want delete files in folder.
    Attached Images Attached Images

  23. #23
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Merge all file in folder.

    Please Login or Register  to view this content.

  24. #24
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    Last requirement.

    I want write data after merge in new file.

  25. #25
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Merge all file in folder.

    Why are you asking one by one?

    I hate how you ask questions...

  26. #26
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.



    I alread told requirement.
    Attached Images Attached Images
    Last edited by adamasmay; 05-26-2022 at 06:43 AM.

  27. #27
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    I am sorry.
    But can you help me for last requirement.

  28. #28
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Merge all file in folder.

    Any idea for solve this case?

+ 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] VBA merge worksheets in a folder - each file in a column, multiple worksheets below
    By bigmantitus in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-11-2021, 12:59 PM
  2. [SOLVED] how to merge multi word file in a folder in one an save it
    By mohadin in forum Word Formatting & General
    Replies: 12
    Last Post: 06-28-2019, 02:59 AM
  3. Need code to merge PDF files in a folder in to single PDF file using adobe reader
    By Anisusa in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-24-2017, 07:40 AM
  4. VBA Code to fetch files in a folder and merge into a "Master file" - Please assist!
    By ClarkKyle in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 05-24-2017, 04:14 AM
  5. Open every file in the folder, remove merge and wrap, save and close files
    By abdesai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2013, 04:58 PM
  6. [SOLVED] How to merge multiple excel files(xls) in one folder into a new xls file.
    By Hayk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 11:48 AM
  7. merge csv files within same folder into one master file
    By dvb_24 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-07-2012, 07:11 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