Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Move multiple files by vba
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Aug 2019
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Move multiple files by vba

    my files are located in C:\Users\WolfieeeStyle\Desktop\Files
    i have to move 4 to 5 files(it can be more than this) from here C:\Users\WolfieeeStyle\Desktop\Files to C:\Users\WolfieeeStyle\Desktop
    condition-check wheather my files are located in C:\Users\WolfieeeStyle\Desktop\Files if yes then move it to C:\Users\WolfieeeStyle\Desktop and if not then do nothing
    Important- i will add the file names in the vba code so that if it is there then it will be moved ( i will put 7 or 8 files name in vba code or more)

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,210
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Move multiple files by vba

    Why not have a look at the question your classmate asked here?
    http://www.vbaexpress.com/forum/show...ve-file-by-vba
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    New Member
    Join Date
    Aug 2019
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Move multiple files by vba

    Sorry Sir I don't know who he is
    and that code is for only 1 file
    and i am dealing with multiple file sir
    Our process is for multiples files Sir

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,210
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Move multiple files by vba

    Funny how the question is very very similar, including the file locations to be used.
    You said you would hardcode the filenames & that is what the code in the link does. Simply repeat the code for the other filenames.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  5. #5
    New Member
    Join Date
    Aug 2019
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Move multiple files by vba

    Sir if i have to move 10 files then i have to make 10 macros sir
    it is not a good option and i think it is not recommendable also sir

  6. #6
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,210
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Move multiple files by vba

    Then how are you going to hardcode the filenames?
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  7. #7
    New Member
    Join Date
    Aug 2019
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Move multiple files by vba

    I don't know sir that's why i am looking for guidance
    Plz Guide Sir
    Last edited by hdgfss; Sep 12th, 2019 at 11:08 AM.

  8. #8
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,794
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Move multiple files by vba

    Here is an article that shows you how you can loop through all files in a folder: http://codevba.com/office/loop_files...m#.XXpgnWlKiCg
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  9. #9
    New Member
    Join Date
    Aug 2019
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Move multiple files by vba

    Sir i tried but i am unable to make it
    plz help sir

  10. #10
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    50,794
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Move multiple files by vba

    hdgfss,

    What you are going to find is that people here typically do not like to do people's homeowrk/assignments for them (that really isn't ethical).
    However, we will be willing to point you in the right direction, give you hints, or critique code that you have come up with. Both Fluff and I have given you tips, but you still not have shown any effort of your own on this question.

    So I suggest you look at the links we have provided, and try to see what coe you can come up with. If it doesn't work out quite right, you can post the code you have attempted here, and we can point out where the problem areas are.
    Last edited by Joe4; Sep 12th, 2019 at 11:33 AM.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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