Hi All,
I found some very helpful code on this forum to edit add borders to a table in word via vba.
Now, I'd like to tweak that code to add a horizontal border to only every nth row. If possible, i'd like to even specify at which row after the top border to start counting.
Here is my code:
Code:
Sub modifyactivetable()
Dim oTbl
With ActiveDocument
Set oTbl = Selection.Tables(1)
With oTbl
.Borders(wdBorderTop).LineStyle = wdLineStyleSingle
.Borders(wdBorderLeft).LineStyle = wdLineStyleSingle
.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
.Borders(wdBorderRight).LineStyle = wdLineStyleSingle
.Borders(wdBorderHorizontal).LineStyle = wdLineStyleSingle
.Borders(wdBorderVertical).LineStyle = wdLineStyleSingle
'.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleSingle
'.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleSingle
End With
End With
Set oTbl = Nothing
End Sub
I'd like to modify the horizontal line statement so that it only takes hold for every other row.