Excel Spreadsheet date comparison
Closed
JohnnyB3
Posts
1
Registration date
Wednesday June 12, 2013
Status
Member
Last seen
June 12, 2013
-
Jun 12, 2013 at 03:13 PM
aquarelle Posts 7140 Registration date Saturday April 7, 2007 Status Moderator Last seen March 25, 2024 - Jun 12, 2013 at 06:26 PM
aquarelle Posts 7140 Registration date Saturday April 7, 2007 Status Moderator Last seen March 25, 2024 - Jun 12, 2013 at 06:26 PM
Related:
- Excel Spreadsheet date comparison
- Excel date format dd.mm.yyyy - Guide
- Excel free download - Download - Spreadsheets
- Excel marksheet - Guide
- Number to words in excel - Guide
- Excel spreadsheet formulas - Guide
1 response
aquarelle
Posts
7140
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
March 25, 2024
491
Jun 12, 2013 at 06:26 PM
Jun 12, 2013 at 06:26 PM
Helo,
Which version of excel do you have ?
You should use conditional formatting.
or the following vba macro which put a red interior colour to the cell containing the oldest date (open VisualBasic Editor by using Alt+F11 keys, click on ThisWorbook and copy/past the macro) :
Regards
Which version of excel do you have ?
You should use conditional formatting.
or the following vba macro which put a red interior colour to the cell containing the oldest date (open VisualBasic Editor by using Alt+F11 keys, click on ThisWorbook and copy/past the macro) :
Sub Test() Dim LastRowA As Long Dim MyPlage As Range, Cel As Range With ThisWorkbook.Worksheets("Sheet1") 'Sheet name need to be adapted to your workbook LastRowA = .Range("A" & Rows.Count).End(xlUp).Row Set MyPlage = .Range("A2:A" & LastRowA) For Each Cel In MyPlage If DateDiff("d", Cel.Offset(0, 1), Cel) < 0 Then Cel.Interior.ColorIndex = 3 Else Cel.Offset(0, 1).Interior.ColorIndex = 3 Cel.Offset(0, 2) = "" End If Next Cel Set MyPlage = Nothing End With End Sub
Regards