Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 09-12-2018, 04:14 PM
jeffreybrown jeffreybrown is offline Pass a range to another macro to bold before em dash Windows Vista Pass a range to another macro to bold before em dash Office 2007
Expert
Pass a range to another macro to bold before em dash
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Thanks Paul. I added the loop and now it works fine.

Code:
Sub Bold_Terms(Rng As Range)
With Rng
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^+"
    .Replacement.Text = ""
    .Forward = True
    .Format = False
    .MatchWildcards = False
    .Wrap = wdFindStop
    .Execute
  End With
  Do While .Find.Found
    With .Duplicate
      .Start = .Paragraphs.First.Range.Start
      .End = .End - 1
      .Font.Bold = True
    End With
    .Collapse wdCollapseEnd
    .Find.Execute
    Loop
End With
End Sub
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two problems: Applying bold affects other tables and canvas doesn't appear at specified range slaycock Word VBA 6 12-08-2016 02:28 AM
Pass a range to another macro to bold before em dash Bold a sentence containing an em dash jeffreybrown Word 8 09-08-2016 05:47 PM
Pass a range to another macro to bold before em dash Reverse Bold macro brent chadwick Word VBA 15 02-26-2016 05:25 PM
Macro Needed to bold specific lines and Macro to turn into CSV anewteacher Word VBA 1 05-28-2014 03:59 PM
Pass a range to another macro to bold before em dash Need Word to change -- (dash,dash) into one long dash. Bobosmite Word 2 05-06-2011 04:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:30 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