Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
border every other cell in range
I'm trying to write a macro that will apply a bottom border to every
other cell in a range. the macro only needs to work for horizontal ranges, and not for vertical ones. the closest i can get is the code below, but this only applys borders to cells in odd columns. i need it to apply borders to every other cell in a selection, regardless if it is even or odd. Sub BotBorderOdd() For Each cell In Selection If Application.WorksheetFunction.Odd(cell.Column) = cell.Column Then oRange = oRange & "," & cell.Address End If Next cell oRange = Mid(oRange, 2, Len(oRange) - 1) Range(oRange).Select With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With End Sub Thanks for your help everyone! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
border on last cell of page effects border on beginning cell of ne | Excel Discussion (Misc queries) | |||
border every other cell in range | Excel Programming | |||
border every other cell in range | Excel Programming | |||
border every other cell in range | Excel Programming | |||
Apply Border to range when first cell has text. | Excel Programming |