Consulting

Results 1 to 3 of 3

Thread: Date Separater

  1. #1
    VBAX Regular
    Joined
    Jan 2013
    Posts
    84
    Location

    Date Separater

    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.
    Attached Files Attached Files

  2. #2
    VBAX Mentor
    Joined
    Jul 2012
    Posts
    398
    Location
    [VBA]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[/VBA]

  3. #3
    VBAX Regular
    Joined
    Jan 2013
    Posts
    84
    Location
    Thanks patel, it works perfectly

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •