+ Reply to Thread
Results 1 to 5 of 5

Looping thought Dates

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    48

    Looping thought Dates

    I'm quite new to VB and I'm trying to figure out how I can loop between two dates. The result should be an xml file which I can import in a different application. Sadly the XML DTD doesn't allow me to use an enddate, so i will need to print each date in a range seperately. This is what I have so far.

    vacDay is not specified, it's where the new date should come everytime in the loop.

    Love to hear some suggestions.


    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Looping thought Dates

    Which dates do you want to loop through?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    06-21-2012
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    48

    Re: Looping thought Dates

    In this case the date would be in vacPeriod1_from and vacPeriod2_to. For example 2015-05-01 and 2015-05-15

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Looping thought Dates

    All you need is this then.
    Please Login or Register  to view this content.
    With your example dates this would go through 2015-05-01, 2015-05-02, 2015-05-03, ..., 2015-05-15.

  5. #5
    Registered User
    Join Date
    06-21-2012
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    48

    Re: Looping thought Dates

    Thanks! It works great

+ 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] Looping through & cutting and pasting values between two dates
    By ShaliniGomes in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-19-2014, 10:33 AM
  2. Looping dates continuously with user option of stopping
    By dem tacos in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2013, 07:54 PM
  3. Looping though a list of dates
    By pablowilks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2013, 01:49 PM
  4. looping with dates
    By johncon in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-07-2009, 07:41 AM
  5. help with looping dates
    By srroduin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-18-2006, 02:10 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