Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Location
    Wilcox, Saskatchewan
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy files to fold if value is true (excel)

    I have taken a post code from another lounger. In this code, the macro goes into a main folder and opens individual folders which hold .xls files. These .xls files hold data in different cells,

    I am pulling out data from cell J7. I would have this cell pasted into my worksheet holding the macro, and move through all the folders holding .xls files. After ill have a list of cells holding the information from cell J7.

    this is all done in Part 1 of this code.

    The code has a part 2.

    I would like to copy the folders which have .xls files with the names highNitro, Nitro, Cbm in J7 and paste them into another folder there are other names in J7 but i only need the ones with the previous names. I was wondering what change I would make to copy folders and pasting them to a seperate folder only if there spread sheet in the .xls file has the names: highratenitro or cbm or nitro gas in J7. instead of renaming them which is done in the code i have attached

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy files to fold if value is true (excel)

    You can do this in one go. The attached text file contains the code. To use it, enter the name of the source folder in F1 (as in your workbook) and the name of the target folder in F2.

    Note: the macro is still named Part1, but you don't need Part2 with this version.

  3. #3
    2 Star Lounger
    Join Date
    May 2005
    Location
    Wilcox, Saskatchewan
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy files to fold if value is true (excel)

    thank you,

Posting Permissions

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