Consolidating multiple excel workbooks into one
it will also have an helper column identifying up to what row belongs to which file. Please, I will like to save the consolidated workbook it in a specific folder with a specific name. Sorry, I'm new to VBA and I will really appreciate your help and effort.
You can use Excel's Consolidate feature to consolidate your worksheets (located in one workbook or multiple workbooks) into one worksheet. If you check Create links to source data, Excel creates a link to your source data (your consolidated data will be updated if your source data changes) and creates an outline.
'Define variables: Dim number Of Files Chosen, i As Integer Dim temp File Dialog As file Dialog Dim main Workbook, source Workbook As Workbook Dim temp Work Sheet As Worksheet Set main Workbook = Application. These functions are very powerful and are supposed to replace the old “Text Import Wizard”. Note: if you don't check Top row and Left column, Excel sums all cells that have the same position. Click in the Reference box, select the range A1: E4 in the district1 workbook, and click Add. Repeat step 4 for the district2 and district3 workbook. Check Top row, Left column and Create links to source data.The next method comes with some disadvantages and is a little bit more complicated.It works, if your files are in a systematic file order and just want to import some certain values.
For example each workbooks have columns from A to CL and each workbooks have the same heading only with varying number of rows in each documents.