Skip to content

Instantly share code, notes, and snippets.

@michaelHL
Last active April 14, 2020 13:53
Show Gist options
  • Save michaelHL/bb71f5f11e915bd64fa969f1631a1546 to your computer and use it in GitHub Desktop.
Save michaelHL/bb71f5f11e915bd64fa969f1631a1546 to your computer and use it in GitHub Desktop.

Revisions

  1. michaelHL renamed this gist Apr 14, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. michaelHL created this gist Jan 6, 2018.
    23 changes: 23 additions & 0 deletions capital.vba
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    Sub captical()
    Selection.WholeStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find.Replacement.Font
    .SmallCaps = False
    .AllCaps = True
    End With
    With Selection.Find
    .Text = "<([A-Za-z])"
    .Replacement.Text = "\1"
    .Forward = True
    .Wrap = wdFindAsk
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchByte = False
    .MatchAllWordForms = False
    .MatchSoundsLike = False
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    End Sub