Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-29-2021, 09:49 AM
Shelley Lou Shelley Lou is offline VBA help to tidy up macro Windows 10 VBA help to tidy up macro Office 2016
Expert
VBA help to tidy up macro
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA help to tidy up macro Footnote extraction macro [Why is this macro so slow? / anyway to make it faster?] Le_Blanc Word VBA 10 03-22-2021 11:38 AM
Spell check macro within macro button field doesn't work in one document samuelle Word VBA 0 07-20-2016 02:27 AM
VBA help to tidy up macro Macro Question: Need help making a macro to highlight the first word in every sentence LadyAna Word 1 12-06-2014 10:39 PM
Macro Needed to bold specific lines and Macro to turn into CSV anewteacher Word VBA 1 05-28-2014 03:59 PM
custom icon, undo/redo for macro, permanent macro Rapier Excel 0 08-05-2013 06:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:45 AM.


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