+ Reply to Thread
Results 1 to 2 of 2

Loop through a folder in the computer

  1. #1
    Registered User
    Join Date
    01-13-2016
    Location
    Europe
    MS-Off Ver
    2013
    Posts
    46

    Loop through a folder in the computer

    Hi,

    I need to do a loop that goes through a folder on the computer. What I'm aiming to do was gather all of the information from a folder of excel files (where files have names I didn’t know & therefore couldn't specify beforehand), of varying names & varying quantity, but with the same defined names & so on within the spreadsheet(for example all the files have the same name for the sheet I'm interested in extracting the data from, but the file names can change or new files can be added to the folder but since is the same template for all of them the cell location and sheet's name will not change)

    Basically the loop should go into each file and look for a specific sheet let's say "abc" then loop through column A with the header set1 and count how many cells containing the word "blue" are, how many with the word "red" and so on (Let's say there are only 3 colors-red, blue, yellow) Then move to column B "set2" and do the same operation . As a result I would like to display in a separate worksheet, from where I run the code, the results in a table with 2 headers set1 and set 2 and the specific result for each color in each set in a sheet called "results". Bothe the header for my table and the sheet name is already predefined, so basically just the numbers have to be added to the tables in the specific cells.

    I would really appreciate some help.

    Thanks,
    Red

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

    Re: Loop through a folder in the computer

    Put this into your workbook, and save it in the same folder as your other files.

    This assumes your table is set up with 7 columns of value - the first for the file name and six for data: red, blue, yellow from column A, then from column B.

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 07-15-2016 at 09:12 AM.
    Bernie Deitrick
    Excel MVP 2000-2010

+ 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. Choose a Folder and Loop a Sub for all files in the chosen folder
    By smartbuyer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2016, 10:57 PM
  2. [SOLVED] Loop Through Folder, Create Emails with Sub Folder Names in Subject, Attach files in sub
    By Rschwar23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2015, 10:06 AM
  3. Replies: 12
    Last Post: 03-09-2015, 05:52 PM
  4. Replies: 1
    Last Post: 10-18-2014, 05:04 PM
  5. move attachment from shared folder to my computer
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2014, 09:33 AM
  6. Generic Path to open a folder from any computer
    By lorena.tgarza in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-14-2012, 04:44 AM
  7. Replies: 5
    Last Post: 08-12-2008, 07:03 PM

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