Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Diff Help
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date Diff Help
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
(date diff.) A2-A1=#value! ? | Excel Worksheet Functions | |||
date in diff. cells | Excel Discussion (Misc queries) | |||
Excel 97 date diff | Excel Worksheet Functions | |||
date (minus) date = working days diff | Excel Discussion (Misc queries) | |||
Date Diff | Excel Discussion (Misc queries) |