+ Reply to Thread
Results 1 to 2 of 2

VBA Loops

  1. #1
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    VBA Loops

    Hi

    I created a VBA loop which loops through a folder and copies a cell range from each CSV file in it and pastes it into a workbook!

    However does anyone know how to make it so when it loops through it only opens files that end with a string which appears in a list in a workbook sheet?

    Thanks

    Jeskit

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: VBA Loops

    No code, no workbook?

    When you loop through the files, check the file name against the list in the workbook. You'll probably need to separate the file name from the path and then use a VLOOKUP or COUNTIF to check for a match.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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