+ Reply to Thread
Results 1 to 6 of 6

VBA Excel - Need Help retrieving same cells from same named files many different subfolder

  1. #1
    Registered User
    Join Date
    01-07-2019
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    3

    Question VBA Excel - Need Help retrieving same cells from same named files many different subfolder

    Hello,

    I am new to VBA but hopefully someone has a moment to help . I have to build a spreadsheet that gathers cell data range from a excel file which has the same file name in many subfolders. The File name I "Performance.xlsx" and is in about 500 different subfolders under the same directory. The data needs to populate 1 spreadsheet. I have the following which works but I need help on getting it to loop through and retrieve from same file in all subfolders.

    here is what I have … Thank you so very much for any help..
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 01-10-2019 at 10:02 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Excel - Need Help retrieving same cells from same named files many different subfo

    Hello Sap-Aggie,

    Welcome to the forum!

    Try this version of your macro. It has been expanded to search the parent folder and all subfolders using the DIR command. This will work on all platforms even Mac. There are other methods you can use like the File System Object or Shell Application Object to do this also.

    Delete your macro and then copy and paste the code below into the module.

    Please Login or Register  to view this content.
    Last edited by Leith Ross; 01-12-2019 at 03:24 PM.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-07-2019
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    3

    Re: VBA Excel - Need Help retrieving same cells from same named files many different subfo

    Thank you so much!!!! I will try it and let you know.

    Again, regardless of my success I want to thank you for your valuable time and willingness to help!

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Excel - Need Help retrieving same cells from same named files many different subfo

    Hello Sap-Aggie,

    You're welcome. That's why I am here.

  5. #5
    Registered User
    Join Date
    01-07-2019
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    3

    Re: VBA Excel - Need Help retrieving same cells from same named files many different subfo

    So greatful! It worked great! Wow do I have a long way to go when looking at your code. Again, thank you so much.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Excel - Need Help retrieving same cells from same named files many different subfo

    Hello Sap-Aggie,

    It is a bit complex. I will answer any questions you have. Just ask.

+ 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. Count pdf files in subfolder problems
    By moosmahna in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2017, 06:39 AM
  2. Replies: 0
    Last Post: 09-18-2015, 03:20 AM
  3. [ask]run VBA to multi files in subfolder
    By qiyusi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-24-2015, 10:24 PM
  4. Move categorized email from Inbox to a subfolder named exactly as the category
    By lennasaurus in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 11-20-2013, 03:24 AM
  5. Files move to a subfolder
    By Jokacave in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-22-2010, 02:13 PM
  6. Named cells across Excel files
    By Rich in forum Excel General
    Replies: 1
    Last Post: 05-03-2006, 03:50 PM
  7. Retrieving deleted Excel files/worksheets
    By Central in forum Excel General
    Replies: 1
    Last Post: 04-20-2005, 05:06 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