View Single Post
 
Old 08-23-2021, 08:45 AM
santy2906 santy2906 is offline Windows 10 Office 2013
Novice
 
Join Date: Aug 2021
Posts: 1
santy2906 is on a distinguished road
Default VBA macro to create word table

Need help creating word table in vba in attached format.

so far I have this code:
Sub ChangeTableBorders(oWordTable As Word.table)
With oWordTable
.Spacing = 9
.Borders.InsideColor = wdColorBlue
.Borders.InsideLineStyle = wdLineStyleDashSmallGap
.Borders.OutsideColor = wdColorBlue
.Borders.OutsideLineStyle = wdLineStyleDashSmallGap
End With
End Sub

Sub ChangeTableRowBorder(oWordTableRow As Word.Row)
With oWordTableRow
.Shading.BackgroundPatternColor = wdColorAutomatic
.Borders(wdBorderBottom).Color = wdColorBlack
.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
.Borders(wdBorderBottom).LineWidth = wdLineWidth050pt
End With
End Sub

I could not create that horizontal line due to spacing.

Any help would be highly appreciated!
Attached Images
File Type: png Table.PNG (2.9 KB, 20 views)
Reply With Quote