View Single Post
 
Old 08-15-2021, 07:38 AM
yacov yacov is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Oct 2019
Posts: 139
yacov is on a distinguished road
Default Select text between 2

Hi'
What is the command in VBA to upper text, I would like to update the macro below.
Thanks

https://www.msofficeforums.com/word/...haracters.html

Sub Find_and_Italicise()
'
' Macro recorded by Bird_FAT
' This macro uses the wildcard '*' to look for text
' between to underscores, then italicises the text.
' The While/Wend statement at the end causes it to
' loop until it reaches the end of the document.
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "_*_"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
While Selection.Find.Execute
Selection.Font.Italic = wdToggle
Wend
End Sub
Attached Images
File Type: jpg UPPER.jpg (12.1 KB, 14 views)
Reply With Quote