title: copy files from source folder to target based on excel list
body: <p>I am using this to try and copy photos that exist in the list within a list in excel. it seems check but doesn't see anything in the source folder and returns the "Does N" from the code below. I have enabled macros and the folders don't see locked. any help would be much appriciated</p>
  
  <pre><code> Option Explicit
  
  Sub CopyFiles()
      Dim iRow As Integer         ' ROW COUNTER.
      Dim sSourcePath As String
      Dim sDestinationPath As String
      Dim sFileType As String
  
      Dim bContinue As Boolean
  
      bContinue = True
      iRow = 1
  
  
      ' THE SOURCE AND DESTINATION FOLDER WITH PATH.
      sSourcePath = "C:\Users\username\Desktop\source\"
      sDestinationPath = "C:\Users\username\Desktop\TARGET\"
  
      sFileType = ".jpg"      ' TRY WITH OTHER FILE TYPES LIKE ".pdf".
  
      ' LOOP THROUGH COLUMN "A" TO PICK THE FILES.
      While bContinue
  
          If Len(Range("A" &amp; CStr(iRow)).Value) = 0 Then    ' DO NOTHING IF THE COLUMN IS BLANK.
              MsgBox "Process executed" ' DONE.
              bContinue = False
          Else
              ' CHECK IF FILES EXISTS.
  
              If Len(Dir(sSourcePath &amp; Range("A" &amp; CStr(iRow)).Value &amp; sFileType)) = 0 Then
                  Range("B" &amp; CStr(iRow)).Value = "Does N"
                  Range("B" &amp; CStr(iRow)).Font.Bold = True
              Else
                  Range("B" &amp; CStr(iRow)).Value = "On Hand"
                  Range("B" &amp; CStr(iRow)).Font.Bold = False
  
                  If Trim(sDestinationPath) &lt;&gt; "" Then
                      Dim objFSO
                      Set objFSO = CreateObject("scripting.filesystemobject")
  
                      ' CHECK IF DESTINATION FOLDER EXISTS.
                      If objFSO.FolderExists(sDestinationPath) = False Then
                          MsgBox sDestinationPath &amp; " Does Not Exists"
                          Exit Sub
                      End If
  
                      '*****
                      ' HERE I HAVE INCLUDED TWO DIFFERENT METHODS.
                      ' I HAVE COMMENTED THE SECOND METHOD. TO THE SEE THE RESULT OF THE
                      ' SECOND METHOD, UNCOMMENT IT AND COMMENT THE FIRST METHOD.
  
                      ' METHOD 1) - USING "CopyFile" METHOD TO COPY THE FILES.
                      objFSO.CopyFile Source:=sSourcePath &amp; Range("A" &amp; CStr(iRow)).Value &amp; _
                          sFileType, Destination:=sDestinationPath
  
                      ' METHOD 2) - USING "MoveFile" METHOD TO PERMANENTLY MOVE THE FILES.
                      'objFSO.MoveFile Source:=sSourcePath &amp; Range("A" &amp; CStr(iRow)).Value &amp; _
                          sFileType, Destination:=sDestinationPath
                      '*****
                  End If
              End If
          End If
  
         iRow = iRow + 1      ' INCREMENT ROW COUNTER.
      Wend
  End Sub
  </code></pre>