Consulting

Results 1 to 3 of 3

Thread: move files from one folder to another whose file names are listed in an excel file

  1. #1

    move files from one folder to another whose file names are listed in an excel file

    Good evening.


    If in a folder I have pdf files: 1,2,3,4,5,6,7,8,9,10


    I would like to move some of these files to another folder in the order shown in an excel column:


    eg:


    3
    6
    8
    10


    Is it possible to do this with a macro?


    Thank you

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Which go to folder 3, which to 6, and so on?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi stefanoste78!
    Suppose 3, 6, 8, 10 are in A1:A4 cells.
    Sub Test()
    Dim i&, oldpath$, newpath$
    oldpath = "???????\" 'Input as needed
    newpath = "???????\" 'Input as needed
    For i = 1 To 4
      Name oldpath & Cells(i, 1) & ".pdf" As newpath & Cells(i, 1) & ".pdf"
    Next i
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •