[COLOR="Navy"]Sub[/COLOR] MG13Feb28
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range, L1 [COLOR="Navy"]As[/COLOR] Range, L2 [COLOR="Navy"]As[/COLOR] Range, nStr [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String[/COLOR]
[COLOR="Navy"]Dim[/COLOR] n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] nn [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
[COLOR="Navy"]For[/COLOR] n = 1 To Rng.Count
[COLOR="Navy"]For[/COLOR] nn = n To Rng.Count
[COLOR="Navy"]If[/COLOR] Not Rng(n).Address = Rng(nn).Address [COLOR="Navy"]Then[/COLOR]
[COLOR="Navy"]If[/COLOR] Abs(CDbl(DateValue(Rng(n))) - CDbl(DateValue(Rng(nn)))) <= 5 [COLOR="Navy"]Then[/COLOR]
nStr = nStr & IIf(nStr = "", Rng(n) & " / " & Rng(nn), vbLf & Rng(n) & " / " & Rng(nn))
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] nn
[COLOR="Navy"]Next[/COLOR] n
[COLOR="Navy"]If[/COLOR] nStr <> "" [COLOR="Navy"]Then[/COLOR]
MsgBox "The following dates are within 5 days of each other:-" & vbLf & nStr
[COLOR="Navy"]Else[/COLOR]
MsgBox "All dates within 5 day Limit"
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]If[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]