+ Reply to Thread
Results 1 to 2 of 2

How to Move specific files to folders with VBA

  1. #1
    Registered User
    Join Date
    05-03-2012
    Location
    World
    MS-Off Ver
    Excel 2010
    Posts
    7

    How to Move specific files to folders with VBA

    Hello all,

    I would like to move files from a specifice folder to several different folders with VBA.

    The files i like to move are stored in a specific folder on C:\Material

    The folder contains different kind of excel files that needs to be moved to different folders each month.

    The beginning of the file name is always the same for each separate file but the month changes.

    I have a listed the file names in excel and also the folder where to move.


    Filen Name Location Correct Folder
    AA MARCH 2012.XLS C:\Material C:\AA
    BB MARCH 2012.XLS C:\Material C:\BB

    Look for filename in A1 in excel sheet - Then look for it in C:\Material If found then Move to C:\AA
    Then Goto next row in excel sheet A2 look for filename - Then if found in C:\Material then move to C:\BB
    End Function


    I ripped one from the internet:

    Please Login or Register  to view this content.
    Last edited by EnzioL; 05-09-2012 at 05:47 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to Move specific files to folders with VBA

    This doesn't create folders, but it will move the files if they exist in the paths as you have described:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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