When I enter the second date in a cell, I want the initial date to be strikethrough and keep both date in the same cell
I have a range of cells from column E to H, in which each cell has a date.
Your help would be highly appreciated
Sub ColorMeElmo()
'
Dim count As Long
count = ActiveSheet.Cells(Rows.count, "D").End(xlUp).Row
'
Dim i As Long, r1 As Range, r2 As Range
For i = 2 To count
Set r1 = Range("D" & i)
Set r2 = Range("E" & i)
Dim diff1 As Long
diff1 = DateDiff("D", r2.Value, r1.Value)
If diff1 <= 5 Then r2.Interior.Color = vbRed
If diff1 > 5 Then r2.Interior.Color = vbYellow
Next i
For ii = 2 To count
Set r1 = Range("D" & ii)
Set r2 = Range("F" & ii)
Dim diff2 As Long
diff2 = DateDiff("D", r2.Value, r1.Value)
If diff2 <= 5 Then r2.Interior.Color = vbRed
If diff2 > 5 Then r2.Interior.Color = vbYellow
End Sub
The range will change from D, E, F, G, and H. But here I give only E