PDA

View Full Version : Date Separater



Ringhal
06-28-2013, 04:56 AM
I have attached a sample file of a workbook I am working with. What I want to do is draw a horizontal (border) line separating the groups of dates in a table. The data is sorted by date automatically. So, as shown in the sample:
25/06/2013
25/06/2013
25/06/2013
-----------
26/06/2013
26/06/2013
... etc.

I suspect the function FIND will work, but I don't know how to use it for this.

I can do this manually, but in future I will need to sort and filter the data.

Any help is greatly appreciated.

patel
06-28-2013, 05:36 AM
Sub a()
LR = Cells(Rows.Count, "A").End(xlUp).Row
For j = 1 To LR
If Cells(j, 5) < Cells(j + 1, 5) Then
With Range("A" & j & ":E" & j).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End If
Next
End Sub

Ringhal
06-28-2013, 06:41 AM
Thanks patel, it works perfectly