title: Sum cell values from multiple workbooks with multiple worksheets - Macro
body: <ul>
  <li>I have 50 workbooks. Each has 3 worksheets.</li>
  <li>I have a value in each of these sheets from cells A1 to N1.</li>
  <li>I want to sum up all the values in a single workbook (in 3 worksheets respectively).
  (i.e. A1 of sheet1 workbook1 + A1 of sheet1 workbook2 +.....+ A1 of sheet1 workbook50 = A1 of sheet1 MacroWorkbook. </li>
  </ul>
  
  <p>Similarly B1 of sheet1 workbook1 + B1 of sheet1 workbook2 +.....+ B1 of sheet1 workbook50 = B1 of sheet1 MacroWorkbook. 
   For 3 sheets and say 50 workbooks.</p>
  
  <p>I would prefer open file location instead of selecting from a directory.</p>
  
  <hr>
  
  <p>With the help of different forums, I have tried getting the sum from multiple workbooks from sheet1:</p>
  
  <pre><code>Sub SUM_Workbooks()
      Dim FileNameXls As Variant
      Dim i As Integer
      Dim wb As Workbook
      FileNameXls = Application.GetOpenFilename(filefilter:="Excel Files, *.xl*", MultiSelect:=True)
      If Not IsArray(FileNameXls) Then Exit Sub
      Application.ScreenUpdating = False
      For i = LBound(FileNameXls) To UBound(FileNameXls)
          Set wb = Workbooks.Open(FileNameXls(i))
          wb.Sheets(1).Range("A1:N1").Copy
          ThisWorkbook.Sheets(1).Range("A1:N1").PasteSpecial Paste:=xlPasteValues, Operation:=xlAdd, SkipBlanks:=True, Transpose:=False
          Application.CutCopyMode = False
          wb.Close SaveChanges:=False
          Next i
      Application.ScreenUpdating = True
  End Sub
  </code></pre>
  
  <p>I would want to extend this for 3 sheets. Help would be much appreciated as I'm no expert in VBA. Thanks!</p>