Consolidating excel workbooks into one
It should be similiar to what schielrn and Norie's codes, but what needs to be change, please suggests. Excel_beginner I don't mean to hijack this thread but I have a similar problem. But the worksheets I am trying to copy are always the 1st worksheet of a xls file. I have 10 source xls files, each one of them has 5 worksheets, I am trying to copy the 1st worksheet of each xls file, that results to one single xls file - with 1 workbook of 10 worksheets.Just copy this into your master workbook and then choose the directory and off you should go.
" End Sub'Description: Combines all files 1st sheet in a folder to a master file Sub Merge Files Without Spaces() Dim path As String, This WB As String, lng Filecounter As Long Dim wb Dest As Workbook, sht Dest As Worksheet, ws As Worksheet Dim Filename As String, Wkb As Workbook Dim Copy Rng As Range, Dest As Range Dim Rowof Copy Sheet As Integer This WB = Active Workbook. Thanks very much Excel_beginner Are these workbooks all stored in the same folder? Open(Filename:=path & "\" & Filename) Set Copy Rng = Wkb. Range(Cells(Rowof Copy Sheet, 1), Cells(Cells(Rows. Are there other workbooks in this folder what will not be combined into one worksheet? So for example would have 4 sheets named One, Two, Three, Four.In every case all information on the underlying worksheets should be copied and combined in the new Workbook as shown below.