+ Reply to Thread
Results 1 to 3 of 3

Nested Do Loops

  1. #1
    Registered User
    Join Date
    12-08-2010
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    14

    Nested Do Loops

    Hi Everyone,

    I am after some help please!

    I am trying to nest a do loop within a do loop so that I can generate multiple iterations. ie the second do loop executes for every loop of the first loop.

    I want to do this because i am trying to write a macro that scans a file system for a folder with a time stamp in the file name (have to use the file name - cannot use date modified) and need to loop backwards through all the possible combinations of hours, days, months and years until the latest folder is found.

    The code that I have written with help doesn’t display any results when I execute it.

    When I comment out each do loop in turn so that there is only one loop executing the message "...is a valid folder/path." is displayed but the folder that the message specifies does not exist when I check

    Please help!


    Please Login or Register  to view this content.
    Last edited by romperstomper; 12-08-2010 at 09:10 AM. Reason: code tags

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Nested Do Loops

    Your solution is here.



  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Nested Do Loops

    Please note that when posting code on the forum you must use code tags. I have added them for you on this occasion as it's your first post, but please use them in future.
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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