Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional borders
The following procedure places borders conditionally as I want but it
does not stop when the Until condition is met. Instead it continues, apparently to the bottom of the sheet, then gives an Error 400 which is no help. I think the problem is Range("C:C") but I don't know how to fix it. Also, I would like to precede this in the same procedure with something that would remove any existing borders. Any help would be appreciated. Public Sub DrawBorders() Dim cell As Range Dim numRows As Single numRows = Selection.CurrentRegion.Rows.Count Do For Each cell In Range("C:C") If cell.Offset(1, 0).Value < cell.Value Then With Range(Cells(cell.Row, 1), Cells(cell.Row, 5)).Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThick .ColorIndex = 1 End With Else End If Next cell Loop Until cell.Row = numRows End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional formatting borders | Excel Discussion (Misc queries) | |||
Conditional Formatting Borders | Excel Discussion (Misc queries) | |||
Conditional Format Borders | Excel Discussion (Misc queries) | |||
Borders and conditional formating | Excel Worksheet Functions | |||
Conditional Borders? | Excel Discussion (Misc queries) |