View Single Post
 
Old 01-20-2025, 07:50 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default Ohhhhh I found a solution, not sure if it's the best but it works

Hello Pros and others reading this.

I've created a macro to search IF a cell is Bold.
If it is, then Remove Bold, then Put Back Bold.

HTML Code:
Sub All_Tables_FNR_IF_Bold_Tuggle_Bold_False_Bold_True()
Dim xTbl As Table
Dim aCel As cell
Dim oRng As Range
  
Application.ScreenUpdating = False

For Each xTbl In ActiveDocument.Range.Tables
  For Each aCel In xTbl.Range.Cells
     If aCel.Range.Font.Bold = True Then

'******** Good below
      
      aCel.Range.Font.Bold = False
      aCel.Range.Font.Bold = True
    End If
  Next aCel
Next
  Application.ScreenUpdating = True
  Application.ScreenRefresh
  DoEvents
  
lbl_Exit:
  Set xTbl = Nothing
  Set oRng = Nothing
  Exit Sub
  
  On Error GoTo 0
  
End Sub
Then if we split the cell, it keeps the bold format. Not sure for the rest, but I imagine doing this for the rest of the tables, before the split.

Maybe there is a other solution, but I'm no expert, but I've managed to find a solution to my problem
Reply With Quote