Consulting

Results 1 to 4 of 4

Thread: how to loop between two dates which moves every hour.

  1. #1

    how to loop between two dates which moves every hour.

    hello,
    can u guys, please give me vba code to compare 2 thing between 2 dates & it should check with loop at every 1 hours time lapse between those 2 dates.

    for example, I would like to compare A, B, C between date 2/20/12 to 2/22/12. It should check 2/20/12 0:00, then 2/20/12 1:00 then 2/20/21 2:00 then so on, upto 2/22/12 23:00.

    In this case nothing is specified abt input A B C. let them get matched everytime. A=B=C i would like to get it print with date & time stamp as result on same sheet at bottom. In this case it may print it 48 times.

    Thanks in advance
    Last edited by for_u_abcdef; 02-27-2012 at 09:39 AM.

  2. #2
    hello, can u guys, please tell me vba code to compare A B C between 2 dates & it should compare A B C at every 1 hours time interval between those 2 dates.

    for example, I would like to compare A, B, C between date 2/20/12 to 2/22/12. It should check 2/20/12 0:00, then 2/20/12 1:00 then 2/20/21 2:00 then so on, upto 2/22/12 23:00.

    In this case nothing is specified abt input A B C. let them get matched everytime. A=B=C i would like to get it print with date & time stamp as result on same sheet at bottom. In this case it may print it 48 times.

    Thanks in advance

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Check out OnTime in VBA Help.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    Quote Originally Posted by mdmackillop
    Check out OnTime in VBA Help.
    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •