+ Reply to Thread
Results 1 to 5 of 5

compare two directories to check if file already exists

  1. #1
    Forum Contributor
    Join Date
    04-06-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    103

    compare two directories to check if file already exists

    Hi

    I have two folders... "folder a" and "folder b" both within the C:\ drive

    Folder B will contain "processed files".
    Folder A will contain new files which are automaticlly placed in there from my email program.

    Is there a way to highlight if the file in Folder A already exists in Folder B?

    If the file does exist then a message is displayed. if the file does not exist then the macro will continue with the rest of the process...

    Any ideas would be great!

    Thanks

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: compare two directories to check if file already exists

    Where would the file be highlighted? Do you have them listed in a spreadsheet somewhere?
    We need more information...
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Forum Contributor
    Join Date
    04-06-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    103

    Re: compare two directories to check if file already exists

    Hi there

    I have found a way to work around this, however it now brings another problem....

    I have a workbook called CHECK.xls with a sheet called Processed. The Processed sheet contains a list of files in column C which are present in the folder C:\processed

    Is there a way to move those files from that folder into C:\processed\ready

    But please bear in mind that I don't want ALL files to be moved, only the ones which are listed in column C in my processed workbook

    Any ideas would be great (or would i be best to start a new topic?)

    Thanks again

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: compare two directories to check if file already exists

    You should start a new thread for this new request. You may find your answer easier by Googling how to move files with vba. Just loop through the file names in your column C.

  5. #5
    Registered User
    Join Date
    04-05-2011
    Location
    Taw City
    MS-Off Ver
    Excel 2003 (i really hate office 2007, 2003 forever!)
    Posts
    6

    Re: compare two directories to check if file already exists

    Also, you should maybe consider getting a Windows Explorer replacement, i.e. a different file manager. PM me if you want non-commercial suggestions. There are some excellent file manager applications which can compare large number of files on different (network) drives, in different directories(folders) and for which you compare them on content.
    These typically also find duplicates, either content-duplicates or name-content-duplicates or name-content-date-duplicates or a combination.

    I hope suggesting this is not against the rules, or any rule.

+ 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