![]() |
|
#1
|
|||
|
|||
|
I have a table. In the the first column, each cell has a word either in italics or not. Is there a way to remove the top and bottom borders for all cells with italic words (in first column only, the other table columns would still have their borders), except if the cell below has a word without italics (in which case the connecting bottom border would remain but top border connecting with cell above containing another italic word would be removed)? A VBA that removed the top border of any cell in the first column with text in Italics only would work.
|
|
#2
|
||||
|
||||
|
For example:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim r As Long
With Selection
If .Information(wdWithInTable) = False Then Exit Sub
With .Tables(1)
.Rows.Alignment = wdAlignRowCenter
For r = 1 To .Rows.Count - 1
If .Cell(r, 1).Range.Characters.First.Font.Italic = True Then
If .Cell(r + 1, 1).Range.Characters.First.Font.Italic = True Then
.Cell(r, 1).Borders(wdBorderBottom).LineStyle = wdLineStyleNone
End If
End If
Next
End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PowerPoint macro to change words between quotes to italic needed | KarenK13 | PowerPoint | 9 | 01-12-2020 12:59 PM |
Stop User Dragging Table Row & Column Borders
|
TartanNeil | Word Tables | 2 | 04-13-2019 04:58 AM |
Remove tabs from certain cells in a table
|
garryjunada | Word Tables | 2 | 07-16-2018 12:51 AM |
Remove borders from cells
|
otuatail | Excel | 1 | 08-12-2016 05:25 AM |
Page-crossing borders in a table with hidden between-cell borders
|
tenpaiman | Word | 2 | 08-08-2012 07:20 PM |