View Single Post
 
Old 12-07-2018, 12:01 AM
ganesang ganesang is offline Windows XP Office 2016
Competent Performer
 
Join Date: Jul 2018
Posts: 170
ganesang is on a distinguished road
Default Need to repeat macro for multiple times

Hi guys

I wanted to repeat/run this macro multiple times at a time.

Code:
Sub get_irf fnf()
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "(\<irf fnf=)(" & ChrW(8220) & _
             "[A-Z 0-9]{1,}" & ChrW(8221) & "/\>)(*)^13"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute
    Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    Selection.Cut
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "(\<irf fnfr=)(" & ChrW(8220) & _
             "[A-Z 0-9]{1,}" & ChrW(8221) & _
            "/\>)-(\<)irf fnf=(" & ChrW(8220) & _
            "[A-Z 0-9]{1,}" & ChrW(8221) & "/\>)"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute
    Selection.PasteAndFormat (wdFormatOriginalFormatting)
    Selection.HomeKey Unit:=wdStory
End Sub
Can anyone help me out on this?

Thanks
Ganesan. G

Last edited by macropod; 12-07-2018 at 03:17 PM. Reason: Added code tags
Reply With Quote