title: excel vba - copy file from one folder to another?
body: <p>I am trying to copy my file from one folder to another folder when a user clicks on a cell in excel.</p>
  
  <p>I keep getting an error saying file not found error, and I don't know why.</p>
  
  <p>my folder names have spaces in so I don't know if this might be the cause of the problem, I have tried removing the spaces in the folder path but same error occurs. can someone please show me what to do thanks in advance </p>
  
  <pre><code>     If Target.Column = Range("C1").Column Then
    If Target.Row &gt; 9 Then
      'Declare Variables
   Dim FSO
   Dim sFile As String
   Dim sSFolder As String
   Dim sDFolder As String
  
  'This is Your File Name which you want to Copy
   sFile = "Supplier Audit.xls"
  
  'Change to match the source folder path
   sSFolder = "\\UKSH000-FILE06\purchasing\New Supplier Set-Ups\assets\"
  
  'Change to match the destination folder path
   sDFolder = "\\UKSH000-FILE06\purchasing\New Supplier Set-Ups\AX ATTACHMENTS\TEST\"
  
  'Create Object
   Set FSO = CreateObject("Scripting.FileSystemObject")
  
  'Checking If File Is Located in the Source Folder
   If Not FSO.FileExists(sSFolder &amp; sFile) Then
   MsgBox "Specified File Not Found", vbInformation, "Not Found"
  
  'Copying If the Same File is Not Located in the Destination Folder
   ElseIf Not FSO.FileExists(sDFolder &amp; sFile) Then
   FSO.CopyFile (sSFolder &amp; sFile), sDFolder, True
   MsgBox "Specified File Copied Successfully", vbInformation, "Done!"
   Else
   MsgBox "Specified File Already Exists In The Destination Folder", vbExclamation, "File Already Exists"
  
  
    End If
    End If
    End If
  </code></pre>