There are three ways to draw diagonal lines in Word tables: Use the custom border function of the table design toolbar. Use the Insert Shape function to create a straight line and set it as a diagonal line. For advanced users, you can use VBA code to automatically add the slash.
Drawing slashes in Word tables
Drawing slashes in Word tables is very simple, you can follow the following Steps to operate:
Method 1: Use the table design toolbar
Method 2: Use the drawing tool
Method 3: Use VBA code
For more advanced users, you can use VBA code to automatically draw slashes in the table.
<code class="vba">Sub AddDiagonalLine() Dim rng As Range Set rng = Selection With rng .Cells(1, 1).MergeCells .Cells(1, 1).Borders(xlDiagonalDown).LineStyle = xlDashed End With End Sub</code>
Copy and paste the above code into the VBA editor, then run the code to add slashes in the selected cells.
The above is the detailed content of How to create slashes in tables in word documents. For more information, please follow other related articles on the PHP Chinese website!