Thread: [Solved] Need Help with this Macro
View Single Post
 
Old 09-23-2018, 07:52 AM
rsrasc rsrasc is offline Windows 10 Office 2013
Competent Performer
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default Need Help with this Macro

Hi all,

I was wondering if the below macro can be adapted so it can be run only with a selected text in a document.

As always, thank you for your assistance and cooperation.

Cheers!


Code:
Sub Macro6()
'
' Macro3 Macro
'
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^p"
        .Replacement.Text = " "
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Font.Bold = wdToggle
    Selection.Font.Bold = wdToggle
    Selection.WholeStory
    Selection.Font.Bold = wdToggle
    Selection.EscapeKey
End Sub
Reply With Quote