VBA Macro to Combine All Workbooks in a Folder into a Single Master Workbook

Поделиться
HTML-код
  • Опубликовано: 15 окт 2024

Комментарии • 44

  • @SGH-rt6ci
    @SGH-rt6ci Год назад

    What can I say ? Crystal clear explanation of a very useful code. Your comments while writing the code helps me understand how VBA works. I find it very helpful. Thank you

  • @yolanderoux2068
    @yolanderoux2068 3 года назад +2

    Thanks, this is great. I have been looking everywhere for something like this. I love that you explain what the code does, it helps to modify it to what you need it for. Thanks again.

  • @ouyang_es
    @ouyang_es Год назад

    Brilliant code and explaination, thank you so mych Chester. I checked several videos on RUclips and your code is the only that works so far.

  • @simplykatm
    @simplykatm Год назад

    This was really helpful and straight to the point , thank you.

  • @rtrbs8383
    @rtrbs8383 5 месяцев назад

    Thank you very much for this code in my work I need combine 214 file....This served me well 🏆🏆

  • @liranadayag495
    @liranadayag495 Год назад

    Hi, this really helps me a lot. But how to change the code to sorting according to the initial letter of the file.

  • @anhnhatnguyet4628
    @anhnhatnguyet4628 2 года назад

    Joining multiple excel files with multiple sheets/every file, the resulting data file is directly put into a single sheet (the files to be joined have the same structure, and the title starts from A1), how to use VBA?
    Hope you make video tutorial about this problem

  • @Alhusam
    @Alhusam 2 года назад

    Thanks Chester. That's really very informative, very practical, and very excellent.

  • @mox8219
    @mox8219 2 года назад

    Clear, concise, and informative as hell. If I could give this more than one like I would. Do you know of any way to open files that are not workbooks? Like PDFs or other file types?

  • @LaurieBerkenstock
    @LaurieBerkenstock Год назад

    @ChesterTugwell - this is great, but how would I make this code dynamic where the user would select the folder where their Excel files have been saved? Also, how would I adjust the sort to sort by worksheet name?

  • @MrHenri911
    @MrHenri911 2 года назад

    Great video! Can I ask, what is the benefit of merging files this way, and not through power query combine and transform function?

  • @aakashmb3893
    @aakashmb3893 4 года назад +2

    Hey can you give me the code to combine all sheets in a workbook into a single sheet in a new workbook

  • @fishfoot123
    @fishfoot123 2 года назад

    Really helpful sir... Thank you very much.

  • @amitkumar-wr3lm
    @amitkumar-wr3lm Год назад

    how to combine multiple excel files or multiple sheets into one excel file but multiple sheets?

  • @k.k5951
    @k.k5951 4 года назад +1

    Thanks for helping. can i take partial workbook name for worksheet. For example i have 100 workbooks with the name of different supplier like. Nestle ltd, coco cola beverage ltd, PepsiCo industry. I want to copy 2nd worksheet from workbook and I need partial name for worksheet like nestle, coca cola, PepsiCo. Please help.

  • @mryagit
    @mryagit 3 года назад

    Hi Chester, question, what if I have a long file name (Super Chester Tugwell File 01 T-1234 00) and I want to remove the first 3 words to be the new file name? Hope you can help

  • @tohneyteoh
    @tohneyteoh 3 года назад

    1. What does "after:" do?
    2. Dir will list the files into an array?

  • @ahmadal-afiq9659
    @ahmadal-afiq9659 3 года назад

    hi chester i followed your tutorial and i may encounter some error mostly its subscript out of range, although i have specified the correct path and everything

  • @shakilahmed-gm4jn
    @shakilahmed-gm4jn 4 года назад +1

    Thanks for video . Code working fine but my question is that if files in the folder are of different names then what amendment will be in code. Please reply ...

    • @psychonerd166
      @psychonerd166 4 года назад

      do you find it? I am working on it right now!

    • @manubhatia7411
      @manubhatia7411 3 года назад

      I also need this answer

  • @eriqutube
    @eriqutube 5 лет назад

    Removed your counter variable as I don't need it, but it's applying ..xls to the end of the file name in the tab. How can I keep that from appearing?

  • @andrewmatthews1369
    @andrewmatthews1369 4 года назад

    Hi Chester. Very well explained. Is it possible to have the entire workbook as a tab along the bottom of the workbook. i have 7 sheets per workbook and 11 workbooks that i wish to put in a master file

  • @PeggywongPeggy
    @PeggywongPeggy 4 года назад

    Hi mine cannot work
    Do While File ""
    Workbooks.Open FolderPath & File
    ActiveWorkbook.Worksheets(1).Copy _
    after:=ThisWorkbook.Worksheets(ThisWorkbook.Worksheets.Count)
    ActiveSheet.Name = Replace(File, ".xlsx", "")
    Workbook(File).Close



    File = Dir()
    Loop
    For i = 1 To 12
    Worksheets(MonthName(i, True)).Move after:=Worksheets(Worksheet.Count)
    Next
    End Sub

  • @mayursatpal6538
    @mayursatpal6538 4 года назад

    does it will work with CSV format file?

  • @PeggywongPeggy
    @PeggywongPeggy 4 года назад

    hi how to add in the header in the active wb

  • @Zandor434
    @Zandor434 4 года назад

    This is great. Thanks for the explanations

  • @stefanescuh
    @stefanescuh 4 года назад

    Thanks a lot for your ideas!

  • @vedanthkiran6448
    @vedanthkiran6448 4 года назад

    thanks for ur video & vba code

  • @mananaeem
    @mananaeem 5 лет назад

    I need code to collect data from different workbooks books in folder and copy each relevant sheet in master file.
    I have three different file in folder and have 3 works sheets in each file. I need to loop through each file and copy relevant sheet to relevant master file. Than data from next file to master workbook. Waiting for reply, please Naeem

    • @ChesterTugwell
      @ChesterTugwell  5 лет назад

      ruclips.net/video/sOyxlkzWIqs/видео.html

    • @mananaeem
      @mananaeem 5 лет назад

      @@ChesterTugwell this good. The method will copy after sheets. I need to have different data. In main collection sheet i want to collect the data on available sheet only. I.e. if in collection sheet i mention three sheets Feb, aug and october so in the folder i need to open each file and first select the feb data then copy to collection sheet than the codr must search for aug than copy and than oct and close the file. After date from path second file to be open collect the required month data and close.
      When i change the month in collection sheet or change the sheet name the loop must search the collection sheet date in each path file. I hope i clarify. Need your guidancr

    • @manubhatia7411
      @manubhatia7411 3 года назад

      @@mananaeem what if the file name is not on the month name

  • @gagankalra221
    @gagankalra221 5 лет назад

    Hi, thanks for the video.
    I want a solution to combine selected sheets of many workbooks in 1 workbook.
    for example i have 2 files:
    File 1 - Part1.xlsx (Sheets - Part1_Data,Chart)
    File 2 - Part2.xlsx (Sheets - Part2_Data,Chart)
    I want to put Part1.Data and Part2.Data sheets in 1 new Excel file (Don't want to copy in workbook having code, it should be separate).
    Can it be done? Please share the code

  • @ashutoshnerkar9558
    @ashutoshnerkar9558 4 года назад

    You are amazing

  • @GLAPhotography
    @GLAPhotography 3 года назад

    so I tried to do it :) my code didn't work XD but I tried