excelvba

Put borders below all the rows with the last date value in a date series


I have an Excel worksheet to record daily flow of business. In the A column is the date of registration and in the other columns information about the item.

I need to put borders below the row of each last date, to visualize the individual dates better.
How the excel should look

How do I run through every date and select the last one of each batch?

With VBA I was able to put borders around specific cells:

Range("A1").Borders(xlEdgeBottom).LineStyle = xlContinuous

I am unable to find out how to reference the specific rows of the sheet.


Solution

  • With conditional formatting

    The formula: =IF($A2<$A3,TRUE,FALSE)

    Apply to : =$A$2:$C$2000 'where C is the last column to underline, 2000 the last row

    Format: Border -> Outline -> Bottom line click

    enter image description here

    enter image description here