title: How to adapt this vba code to only copy from first worksheet
body: <p>I would like to change the following code below to only copy the first worksheet, rather than every worksheet. I am a complete noob at VBA, so I'm not really sure </p>
  
  <pre><code> Sub MergeExcelFiles()
      Dim fnameList, fnameCurFile As Variant
      Dim countFiles, countSheets As Integer
      Dim wksCurSheet As Worksheet
      Dim wbkCurBook, wbkSrcBook As Workbook
  
      fnameList = Application.GetOpenFilename(FileFilter:="Microsoft Excel 
      Workbooks (*.xls;*.xlsx;*.xlsm),*.xls;*.xlsx;*.xlsm", Title:="Choose Excel 
      files to merge", MultiSelect:=True)
  
      If (vbBoolean &lt;&gt; VarType(fnameList)) Then
  
          If (UBound(fnameList) &gt; 0) Then
              countFiles = 0
              countSheets = 0
  
              Application.ScreenUpdating = False
              Application.Calculation = xlCalculationManual
  
              Set wbkCurBook = ActiveWorkbook
  
              For Each fnameCurFile In fnameList
                  countFiles = countFiles + 1
  
                  Set wbkSrcBook = Workbooks.Open(Filename:=fnameCurFile)
  
                  For Each wksCurSheet In wbkSrcBook.Sheets
                      countSheets = countSheets + 1
                      wksCurSheet.Copy after:=wbkCurBook.Sheets(wbkCurBook.Sheets.Count)
                  Next
  
                  wbkSrcBook.Close SaveChanges:=False
  
              Next
  
              Application.ScreenUpdating = True
              Application.Calculation = xlCalculationAutomatic
  
              MsgBox "Processed " &amp; countFiles &amp; " files" &amp; vbCrLf &amp; "Merged " &amp; countSheets &amp; " worksheets", Title:="Merge Excel files"
          End If
  
      Else
          MsgBox "No files selected", Title:="Merge Excel files"
      End If
  End Sub
  </code></pre>
  
  <p>I thought I could just change </p>
  
  <pre><code>wksCurSheet.Copy after:=wbkCurBook.Sheets(wbkCurBook.Sheets.Count)
  </code></pre>
  
  <p>to</p>
  
  <pre><code>wksCurSheet(1).Copy after:=wbkCurBook.Sheets(wbkCurBook.Sheets.Count)
  </code></pre>
  
  <p>but clearly that doesnt work</p>
  
  <p>Thanks!</p>