PC Review


Reply
Thread Tools Rate Thread

Date Diff Help

 
 
kiran
Guest
Posts: n/a
 
      24th Sep 2008
Dear All,

A B C D E
Date Time Date Time Output
04.07.08 9:18:56 AM 01.08.08 7:41:33 PM
04.08.08 9:18:56 PM 01.08.08 7:41:33 PM
24.08.08 10:05:03 AM 22.08.08 12:13:30 PM

Check date time in column A, B, C & D if date & time of column C & D is
greater that date time of column A & B I should get "No" else "Yes" in column
E.

TIA
 
Reply With Quote
 
 
 
 
RyanH
Guest
Posts: n/a
 
      24th Sep 2008
This should work for you. This macro will run down rows 2 thru last row in
Col.A

Option Explicit

Sub TestDates()

Dim i As Long

For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If (Cells(i, "A").Value And Cells(i, "B").Value) < _
(Cells(i, "C").Value And Cells(i, "D").Value) Then
Cells(i, "E").Value = "Yes"
Else
Cells(i, "E").Value = "No"
End If
Next i

End Sub

Hope this helps! If so, please click "YES" below.
--
Cheers,
Ryan


"kiran" wrote:

> Dear All,
>
> A B C D E
> Date Time Date Time Output
> 04.07.08 9:18:56 AM 01.08.08 7:41:33 PM
> 04.08.08 9:18:56 PM 01.08.08 7:41:33 PM
> 24.08.08 10:05:03 AM 22.08.08 12:13:30 PM
>
> Check date time in column A, B, C & D if date & time of column C & D is
> greater that date time of column A & B I should get "No" else "Yes" in column
> E.
>
> TIA

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Diff SageOne Microsoft Access 6 4th Feb 2010 05:58 PM
Date Diff lmossolle Microsoft Access Queries 5 27th May 2009 08:23 PM
Date Diff Dan @BCBS Microsoft Access Queries 2 29th Apr 2008 09:30 PM
Date Diff PJ Microsoft Access Queries 1 2nd Mar 2008 12:10 AM
date (minus) date = working days diff jjj Microsoft Excel Misc 3 6th Dec 2005 03:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:16 AM.