Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2022, 06:00 AM
Davidl88 Davidl88 is offline Remove borders in first table column cells with italic words Windows 10 Remove borders in first table column cells with italic words Office 2016
Novice
Remove borders in first table column cells with italic words
 
Join Date: Sep 2022
Posts: 5
Davidl88 is on a distinguished road
Default Remove borders in first table column cells with italic words

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.
Reply With Quote
  #2  
Old 09-05-2022, 03:45 PM
macropod's Avatar
macropod macropod is offline Remove borders in first table column cells with italic words Windows 10 Remove borders in first table column cells with italic words Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply

Thread Tools
Display Modes


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
Remove borders in first table column cells with italic words Stop User Dragging Table Row & Column Borders TartanNeil Word Tables 2 04-13-2019 04:58 AM
Remove borders in first table column cells with italic words Remove tabs from certain cells in a table garryjunada Word Tables 2 07-16-2018 12:51 AM
Remove borders in first table column cells with italic words Remove borders from cells otuatail Excel 1 08-12-2016 05:25 AM
Remove borders in first table column cells with italic words Page-crossing borders in a table with hidden between-cell borders tenpaiman Word 2 08-08-2012 07:20 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft