VBA Code to copy worksheets/workbooks into one new workbook

  • I have tried a few VBA codes to either combine 12 workbooks into one (all with 6 worksheets so new workbook would have 76 worksheets) or also to create 6 new workbooks all with the same sheet from the 12 workbooks (all 12 x Sheet1 in one workbook, all 12 x Sheet2 in another). I would prefer the first option. I have tried the below option and had limited success. I get a run-time error 1004 'That name is already taken. Try a different one'.


    All worksheets within the individual workbooks have the same name.


    Using this code, seems to let me combine 3 workbooks before the error appears


    _________________________________________________________



    Moderator Comment: Please read the rules you agreed to when you joined this forum. Pay particular attention to the rule on Code Tags. I have added them for you today. Please comply in the future.

  • Re: VBA Code to copy worksheets/workbooks into one new workbook


    *Update*


    Tried the code from post started by gani below...same result...let me copy 3 workbooks before same error appearing