PDA

View Full Version : how to loop between two dates which moves every hour.



for_u_abcdef
02-27-2012, 08:46 AM
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

for_u_abcdef
02-27-2012, 10:07 AM
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

mdmackillop
02-27-2012, 11:27 AM
Check out OnTime in VBA Help.

for_u_abcdef
02-27-2012, 05:06 PM
Check out OnTime in VBA Help.
Thank you.