Thread: [Solved] VBA help to tidy up macro
View Single Post
 
Old 01-29-2021, 09:49 AM
Shelley Lou Shelley Lou is offline Windows 10 Office 2016
Expert
 
Join Date: Dec 2020
Posts: 259
Shelley Lou is on a distinguished road
Default VBA help to tidy up macro

Hi, I have tried to tidy up/shorten the below macro to put all the functions to remove bold from para marks, commas, full stops, semi-colons into a single function but everything I try just doesn't seem to work. Can anyone help at all? Thanks, Shelley



Code:
  With oRng.Find
    'remove bold from para marks'
    .Text = "^p"
    .Replacement.Text = "^p"
    .Replacement.Font.Bold = False
    .Execute Replace:=wdReplaceAll
  End With
     With oRng.Find
    'remove bold from semi colons
    .Text = ";"
    .Replacement.Text = ";"
    .Replacement.Font.Bold = False
    .Execute Replace:=wdReplaceAll
  End With
   With oRng.Find
    'remove bold from commas
    .Text = ","
    .Replacement.Text = ","
    .Replacement.Font.Bold = False
    .Execute Replace:=wdReplaceAll
  End With
   With oRng.Find
  'remove bold from full stops
    .Text = "."
    .Replacement.Text = "."
    .Replacement.Font.Bold = False
    .Execute Replace:=wdReplaceAll
  End With
Reply With Quote