1) List in Playlist column B, each entry is a full path and filename in a single text string
2) Destination directory is listed on Config sheet cell C2 and should be used for all files
3) Destination path may need to be created
I don't have a set of files to test on, but confidence is high. Try it out on a Playlist with only 3 entries (still need to be formulas), and make sure one of the files listed doesn't exist.
4) This macro will mark column C with "Moved" or "Not Found"
Option Explicit
Sub MoveFiles()
Dim MyFiles As Range, f As Range, destPATH As String, fNAME As String, Delim As String
Delim = Application.PathSeparator
destPATH = ThisWorkbook.Sheets("Config").Range("C2").Value
If Len(destPATH) = 0 Then
ThisWorkbook.Sheets("Config").Activate
Range("C2").Select
MsgBox "Invalid destination"
Exit Sub
Else
If Right(destPATH, 1) <> Delim Then destPATH = destPATH & Delim
End If
On Error Resume Next
MkDir destPATH
On Error GoTo 0
Set MyFiles = ThisWorkbook.Sheets("Playlist").Range("B:B").SpecialCells(xlFormulas)
For Each f In MyFiles
If Len(f.Value) > 0 Then
If Len(Dir(f.Value)) > 0 Then
fNAME = Right(f.Value, Len(f.Value) - InStrRev(f.Value, Delim))
Name f.Value As destPATH & fNAME
f.Offset(, 1).Value = "Moved"
Else
f.Offset(, 1).Value = "Not Found"
End If
End If
Next f
End Sub
Bookmarks