+ Reply to Thread
Results 1 to 2 of 2

Help looping through subfolders?

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    73

    Help looping through subfolders?

    Hello,

    Doing a find-and-replace macro with UI out of word and so far I have it working with the base folder that the user points to. But, if there are subfolders inside that base folder, nothing is done for those. How can I implement looping through subfolders in the below? Not sure where to begin... please note there's a separate function to determine the folder path and assign as "strFolder". Cheers and thanks in advance.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Help looping through subfolders?

    I would normally use a recursive code to do this, i.e.

    Please Login or Register  to view this content.
    Although I would normally use filesystemobject rather than dir for looping through folders.

+ 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. [SOLVED] list of subfolders in folder - without files and sub-subfolders
    By MartyZ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-11-2022, 10:56 AM
  2. Looping through subfolders
    By ECSTFSS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2013, 12:11 PM
  3. Looping through Subfolders within a Parent Folder
    By bocaj315 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-29-2013, 03:04 PM
  4. [SOLVED] Check if a file exists in subfolders by looping through excel range
    By Duhwellhuh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-16-2012, 09:10 PM
  5. How to modify current looping directory program to include subfolders
    By 1SLwLS1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2010, 12:37 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