Anyone here know how to change my code to draw a horizontal thick border after each number sequence change in column B.
I have searched all the canned excel views and none work, seems like a lot of folks would need to make the excel report presentable by automation, I cannot figure out the sequence change part?
Code:
Dim r As Range
Set r = Range(Range("b8"), Range("b" & Rows.Count).End(xlUp))
r.Select
Dim cell As Range
For Each cell In r
'************************************************
'Draw Horizontal Lines or clear horizontal lines
'************************************************
If cell.Offset(1, 0).Value <> "" Then Call DrawThickHoriziontalLineBelowRange(Range(Cells(cell.Row, 2), Cells(cell.Row, 12)))
Next cell
End Sub
Sub DrawThickHoriziontalLineBelowRange(r As Range)
With r.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
End Sub
Sub ClearHoriziontalLineBelowRange(r As Range)
r.Borders(xlEdgeBottom).LineStyle = xlNone
End Sub
Bookmarks