title: Compiling data from all workbooks in a folder
body: <p>I have a folder with 150+ timesheets that are formatted the exact same way and that I want compiled in a "master" workbook. Namely, I need 4 cells per timesheet to be replicated in the master:</p>
  
  <p>Cell C4 (date)
  Cell B7 (name of employee)
  Cell I50 (hours on site)
  Cell H50 (hours in office)</p>
  
  <p>The master workbook would have to look like this:</p>
  
  <p>[Master workbook: the goal][1]</p>
  
  <p>Simply said: I need a macro that runs though all excel files in a specific folder and copies information to a "master" workbook.</p>
  
  <p>I'm not an expert at this but I can handle some beginner level macros. I really need this so any help is appreciated! Thanks!</p>
  
  <p>EDIT: I found a macro that copies the second row of each file. That's a starting point but I don't have the skills to edit it...</p>
  
  <pre><code> Sub ConFiles()
  
      Dim Wbname As String
      Dim Wb As Workbook
      Dim ws As Worksheet
      Dim ws1 As Worksheet
      Dim lngCalc As Long
      Dim lngrow As Long
  
      With Application
          .ScreenUpdating = False
          .EnableEvents = False
          lngCalc = .CalculationState
          .Calculation = xlCalculationManual
      End With
  
  
     Set ws1 = ThisWorkbook.Sheets.Add
      'change folder path here
      FolderName = "J:\15-0023_Vauquelin\8.0 Phase-construction\FdT fictives"
      Wbname = Dir(FolderName &amp; "\" &amp; "*.xls*")
  
      'ThisWorkbook.Sheets(1).UsedRange.ClearContents
      Do While Len(Wbname) &gt; 0
          Set Wb = Workbooks.Open(FolderName &amp; "\" &amp; Wbname)
          Set ws = Nothing
          On Error Resume Next
          'change sheet name here
          Set ws = Wb.Sheets("Heures")
          On Error GoTo 0
          If Not ws Is Nothing Then
          lngrow = lngrow + 1
          ws.Rows(2).Copy ws1.Cells(lngrow, "A")
          End If
          Wb.Close False
          Wbname = Dir
      Loop
  
      With Application
          .ScreenUpdating = True
          .EnableEvents = True
          .Calculation = lngCalc
      End With
  End Sub
  </code></pre>