+ Reply to Thread
Results 1 to 5 of 5

Serching files basis list

  1. #1
    Registered User
    Join Date
    04-23-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    18

    Exclamation Serching files basis list

    I am having problem with the below code. I have a folder containing xls files and a list of files. Files are names like FTF_8_998.xls and the list has entries like 8_998, so i need to match the (8_998 with FTF_8_998. I use the code to sort the files in different folders basis a list. Now the problem comes when a file is not found as per the list. For example i have a file FTF_9_1.xls, and the list does not contain 9_1. So when i run the code it is stuck in an infinite loop.

    Requirement: Either the non existing file is moved to another folder.... or it stays there and the code moves on.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,912

    Re: Serching files basis list

    A better way to get a folder is to use the folder picker dialog:

    Please Login or Register  to view this content.
    And after you get the file name, check to see if the root value is in your list
    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    04-23-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    18

    Re: Serching files basis list

    Thanks for replying. Dosen't seem to work though. Please see the new code , maybe i placed it wrongly.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,912

    Re: Serching files basis list

    You need to check after the file has been selected:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-23-2015
    Location
    india
    MS-Off Ver
    2010
    Posts
    18

    Re: Serching files basis list

    Thanks for the response.. i did something different. I created a new code for finding and sorting the files (found and not found) basis the list. Then run the old code successfully.

    New code block:
    Please Login or Register  to view this content.

+ 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. read a line from external text files on a random basis
    By Loski in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-14-2015, 11:44 AM
  2. Splitting files into multiple workbooks on the basis of specific column
    By kundanlal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2014, 03:47 PM
  3. Serching for cells in a table.
    By yachrishere in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-22-2014, 08:58 PM
  4. Search multiple files on a row or cell basis
    By Buzzed Aldrin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2014, 04:32 PM
  5. Serching data using text box in user form
    By jiguvaidya in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-13-2008, 07:36 AM

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