+ Reply to Thread
Results 1 to 7 of 7

Loop through folder and add cells from each file

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Office 2010
    Posts
    96

    Loop through folder and add cells from each file

    Hello!

    Here is my situation: I have a folder that has multiple files that i would like to pull data from. This data is in the same cell in each file so all i would like to do is add the total value up at the end once it finished looping through all the files and display it on my sheet. Some of these files could have 1 worksheet where others might have 3-4. If I only have 1 file in the folder it works perfectly fine but as soon as the second file opens i get a Subscript Out of Range error (See code below for the line this error occurs on). Any help is appreciated! Thanks.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Loop through folder and add cells from each file

    Duplicate post.
    Last edited by Solus Rankin; 03-20-2014 at 01:46 PM. Reason: dup
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Loop through folder and add cells from each file

    Please Login or Register  to view this content.
    Untested
    Last edited by Solus Rankin; 03-20-2014 at 01:47 PM. Reason: code edit

  4. #4
    Registered User
    Join Date
    02-21-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Office 2010
    Posts
    96

    Re: Loop through folder and add cells from each file

    I get an Object or property not supported by this method error on the following line:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Loop through folder and add cells from each file

    Sorry. That's supposed to be
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by Solus Rankin; 03-20-2014 at 01:57 PM.

  6. #6
    Registered User
    Join Date
    02-21-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Office 2010
    Posts
    96

    Re: Loop through folder and add cells from each file

    Works Perfectly. Thanks

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Loop through folder and add cells from each file

    Thanks for marking the thread as [SOLVED].

    On any thread you can show appreciation to those who have helped you by clicking the * below their post.

+ 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. Replies: 3
    Last Post: 01-05-2014, 05:50 AM
  2. [SOLVED] Loop through folder and create tab for the short name of each file and copy range of cells
    By mongoose36 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-06-2013, 02:08 PM
  3. Replies: 1
    Last Post: 11-01-2013, 03:22 PM
  4. [SOLVED] Loop Search for PDF file in folder
    By ANDREWA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2012, 02:18 PM
  5. Save File As Cell Value (loop through folder)
    By uncleslinky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2012, 04:02 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