+ Reply to Thread
Results 1 to 6 of 6

VBA to copy files that contain certain text within filename from one folder to another

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    15

    VBA to copy files that contain certain text within filename from one folder to another

    Hi All,

    I need a VBA that can go through a certain folder and copy files that contain a certain text into another folder. For example.

    I have 100 PDF files in 'FOLDER A'

    I need to go through 'FOLDER A' and find the PDF files that contain the word 'Sydney' and copy it in folder called 'FOLDER - Sydney'. Then find the files that contain the word 'Melbourne and copy it into 'FOLDER - Melbourne', and so on untill i have completed the string requirements.

    If you can help me with this it would be great!!!!


    Thanks Guys!



    Below is a VBA i tried to manipulate, however it did not work and dont know how to loop it into another target folder.

    Please Login or Register  to view this content.
    - list of words i was looking for.

    Please Login or Register  to view this content.
    Last edited by Leith Ross; 07-24-2013 at 10:55 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA to copy files that contain certain text within filename from one folder to another

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    05-17-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: VBA to copy files that contain certain text within filename from one folder to another

    Brilliant!

    Thanks Patel45. Also

    If i wanted to add more to this. say that now If i wanted to move all files that contain 'Melbourne' to 'FOLDER - Melbourne' (and so on)within the same VBA how do i add on the other requirements.

    instead of just Sydney i want add on other requirements.

    Sydney to FOLDER - Sydney
    Melbourne to FOLDER - Melbourne
    Brisbane to FOLDER Brisbane
    etc.

    If you can advise of the code to set for each location, i cna apply that to the rest.

    Thanks Patel Appeciate it!

    Neil.

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA to copy files that contain certain text within filename from one folder to another

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-17-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: VBA to copy files that contain certain text within filename from one folder to another

    You have been a great help Patel45!

    Thank you.

  6. #6
    Registered User
    Join Date
    08-29-2013
    Location
    Poland
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: VBA to copy files that contain certain text within filename from one folder to another

    What in case |I have a list of files not one word?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA Code open files in folder, copy text to workbook-Next time folder opened copy only new
    By Bikeman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2013, 07:59 PM
  2. excel macro to copy data from multi text files in a folder to a single work sheet
    By dil_se in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2012, 08:10 AM
  3. open all files in a folder with fixed number of characters in filename
    By Telemick in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-18-2012, 03:31 AM
  4. Copy Files to other folder
    By TISR in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-01-2006, 03:50 AM
  5. How to copy 30 csv files from a folder to another folder
    By ddiicc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2005, 05:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1