Consolidating multiple workbooks
The ability to browse and select the files would be nice if this ever changes but if that is too difficult, just indicating the directory path in the Visual Basic code would work. Name = Wrd Array(0) total = Workbooks("import-sheets.xlsm").
As far as the resultant combined output probably ought to be a new workbook, the filename of the new workbook isn't that important. Option Explicit Private Sub Command Button1_Click() Dim directory As String, file Name As String, sheet As Worksheet, total As Integer Dim Wrd Array() As String Application. Display Alerts = False directory = "c:\test\" file Name = Dir(directory & "*.xl?? Open (directory & file Name) Wrd Array() = Split(file Name, ".") For Each sheet In Workbooks(file Name).
So for example would have 4 sheets named One, Two, Three, Four. gist.github.com/wviana/31d8dac7718b952e1ccf43eb3ee062be I settled some vars, to facilitate the operation, removing the need to call @Jay C the code is there, right in the macro, changing it to create new workbook or renaming sheets are simple one-liners. You have to show some effort, write some code, show it and Stack Overflow can help you diagnose and overcome concrete coding problems.
In every case all information on the underlying worksheets should be copied and combined in the new Workbook as shown below. Display Alerts = True End Sub Not necessary anymore, thank you for your post. I suggest that you start solving your task by trying to understand those ~50 lines of code in the and perhaps spawn some new more concrete coding questions.
However the tabs are not named from the name of the original file. In this case a coworker was able to get me started and I further modified it to meet my needs.
For now all the underlying Workbooks will be in the same folder.
You can use Excel's Consolidate feature to consolidate your worksheets (located in one workbook or multiple workbooks) into one worksheet.
Below you can find the workbooks of three districts.
I found this Macro / Add-In online that gets me close to what I need using the open files add in choice. Worksheets(total) Go To exit For: Next sheet exit For: Workbooks(file Name). So far you are doing quite well Thanks, I agree and understand some effort and a template for the problem is needed.
The Open Files Add-In successfully allows me to aggregate the various Workbook's worksheets into a single workbook. Unfortunately the linked macro is not editable so I couldn't use it to guide me.
For example One.xlsx, Two.xlsx, Three.xlsx, each contain information on their respective Sheet1.
I need the information on Sheet1 from each workbook to be combined into a single workbook with sheets that are named from the file name of the original workbook.