Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Could some bush up this vba? I need to color the edge of
the first cell. in a sequence of cells. A B C D E 1 99 2 3 4 13 2 6 12 1 2 23 In the above example in row 1 -- 2&3&4 are in sequence thereby Cell B1 would have a yellow left hand edge colored. Similarly, in row 2 -- 1&2 are in sequence thereby Cell C2 would have a yellow left hand edge colored Sub ColorFirstEdgeSeq() Dim x As Range With Sheets("Sheet1") Set x = .Range(.Range("A1"), .Range("E2")) End With For Each C In x If C.Value = (C.Offset(0, 1).Value - 1) Then Range(C, C.Offset(0, 1)).Select With ActiveCell.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThick .ColorIndex = 36 End With End If Next Range("A1").Select End Sub With Thanks Steve |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I print edge to edge with absolutely NO margins | Excel Worksheet Functions | |||
How do you get rid of the outside edge with the numbers and lette. | Excel Discussion (Misc queries) | |||
How do I bring text to the edge of the page? | Excel Discussion (Misc queries) | |||
Printing cannot go close to edge of paper | Excel Discussion (Misc queries) | |||
How to copy "edge" formatting to other cells. | Excel Discussion (Misc queries) |