Thread: [Solved] Need Help with this Macro
View Single Post
 
Old 09-23-2018, 11:24 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Not sure exactly what you are trying to do, but something like this:

Code:
Sub Macro6()
Dim oRng As Range
Dim oRNg2 As Range
  Selection.Find.ClearFormatting
  Selection.Find.Replacement.ClearFormatting
  Set oRng = Selection.Range
  Set oRNg2 = oRng.Duplicate
  With oRng.Find
    .Text = "^p"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    Do While .Execute
      If oRng.InRange(oRNg2) Then
        oRng.Text = " "
        oRng.Font.Bold = wdToggle
        oRng.Collapse wdCollapseEnd
      Else
        oRng.Collapse wdCollapseEnd
        Exit Do
      End If
    Loop
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote