Example of consolidating excel workbooks
Upon reading the title of this section, some of you may be confused.
There is one master file (or sheet) which needs to be consolidated by pulling data from multiple source files containing raw data (having the same data structure). If you are new to VBA, Excel macros, go thru these links to learn more.
There are many ways to consolidate data in Microsoft Excel.
You can use the Table feature and its associated filters to filter a list so it shows only those items you are interested in seeing and you can create Pivot Tables to look at your data in different ways.
Open str File Name, Update Links:=False, Read Only:=True Set data WB = Active Workbook Range(str Copy Range). We open the data workbook by using the Application. Next we select the data that has been assigned to the copy range and copy to the clipboard.
Inside our loop are the 4 variables which are assigned the 1) File name, 2) Copy Range, 3) Where To Copy and 4) Which Column contains the starting cell to paste data. Once we have our first data workbook open, we assign this to the data WB variable so that we can easily switch between the two workbooks and close them when the operation has been completed.