0

I am merging two folders but there might be new subfolders that must be created so I need to see if a sub folder exist, if not create a new one, move the files in the folder and skip errors if the file does not exist in the list being checked. this is the excel sheet for sourcethis is the output

Sub MoveFiles()
fileLocation = "/Users/wynandgoosen/Downloads/SULL/Drive/About/" 'change to the top level parent folder

Range("A2").Select

'loop through all records in the list
'identifieswhich have been marked as archive
'move the marked files to the ARCHIVE folder

Do While ActiveCell.Value <> ""
    If ActiveCell.Offset(0, 3).Value = "Move" Then
        Name ActiveCell.Offset(0, 2).Value & "/" & ActiveCell.Offset(0, 1).Value As _
        fileLocation & ActiveCell.Value & "/" & ActiveCell.Offset(0, 1).Value

On Error Resume Next

ActiveCell.Offset(0, 2).Value = fileLocation
ActiveCell.Offset(0, 3).Value = "YES"

End If

ActiveCell.Offset(1, 0).Select
Loop

End Sub
BruceWayne
  • 22,449
  • 14
  • 60
  • 100
  • Does this thread help? [Create folder path if does not exist (saving issue)](https://stackoverflow.com/a/43658771) – BruceWayne Sep 14 '21 at 18:42

0 Answers0