R
Rick Rothstein
No, your description was fine... my last post telling you to ignore this
code crossed with the message I am now responding to. I am quite hopeful
that this code will do what you want...
Sub Demo()
Dim R As Range
Dim C As Range
Dim Prev As Range
Dim X As Integer
Dim LastRow As Long
Dim StartRow As Long
StartRow = 2
With Worksheets("Sheet1")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set R = Intersect(.Rows().SpecialCells(xlCellTypeVisible), _
.Range("A" & StartRow & ":A" & LastRow))
Set Prev = .Cells(LastRow + 1, "A")
For Each C In R
If C.Value <> Prev.Value Then
With C.Resize(1, 27).Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 9
End With
End If
Set Prev = C
Next
End With
End Sub
code crossed with the message I am now responding to. I am quite hopeful
that this code will do what you want...
Sub Demo()
Dim R As Range
Dim C As Range
Dim Prev As Range
Dim X As Integer
Dim LastRow As Long
Dim StartRow As Long
StartRow = 2
With Worksheets("Sheet1")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set R = Intersect(.Rows().SpecialCells(xlCellTypeVisible), _
.Range("A" & StartRow & ":A" & LastRow))
Set Prev = .Cells(LastRow + 1, "A")
For Each C In R
If C.Value <> Prev.Value Then
With C.Resize(1, 27).Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 9
End With
End If
Set Prev = C
Next
End With
End Sub