title: How to Import Specific Sheet to Another Workbook with VBA
body: <p>I try to create a program that can collect every "UTP" sheet in one folder into one "Master UTP" workbook (located in the same folder)</p>
  
  <p>So, first I need to read all file xls in folder.
  Copy "UTP" sheet and paste it to "Master UTP".
  Then do looping again.</p>
  
  <p>This is the code that I make so far in "Master UTP":</p>
  
  <pre><code>Public Sub myImport()
  Dim sPathName As String, sFileName As String
  Dim sourceWb As Workbook, targetWb As Workbook
  
  Set sourceWb = ActiveWorkbook
  
  sPathName = ThisWorkbook.Path &amp; "\"
  sFileName = Dir(sPathName &amp; "*.xls", vbNormal)
  
  Do While Len(sFileName) &gt; 0
      sFileName = sPathName &amp; sFileName
  
      If sFileName &lt;&gt; sourceWb Then
          Set targetWb = Workbooks.Open(sName)
          targetWb.Sheets("UTP").Copy After:=sourceWb.Sheets("Master UTP")
          targetWb.Close
      End If
  
      sFileName = Dir
  Loop
  End Sub
  </code></pre>
  
  <p>There still some mistake in this program. Please help.
  Thanks.</p>