Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2021, 07:38 AM
yacov yacov is offline Select text between 2 Windows 10 Select text between 2 Office 2016
Competent Performer
Select text between 2
 
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
  #2  
Old 08-15-2021, 08:40 PM
gmayor's Avatar
gmayor gmayor is offline Select text between 2 Windows 10 Select text between 2 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Your question asks for upper case. Your screen shot indicates superscript. The following will do both
Code:
    While Selection.Find.Execute
        Selection.Font.AllCaps = True
        Selection.Font.Superscript = True
    Wend
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 08-15-2021, 10:16 PM
yacov yacov is offline Select text between 2 Windows 10 Select text between 2 Office 2016
Competent Performer
Select text between 2
 
Join Date: Oct 2019
Posts: 139
yacov is on a distinguished road
Default

thanks Graham, works great.

Superscript was the question.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select all text in multiple text boxes Virgule Word 0 06-07-2017 12:11 PM
Select text between 2 After putting a text box behind text I can't select it anymore Mike84bs Word 2 07-25-2016 07:36 AM
VBA Search Table for Text/Select Text/Insert Hyperlink sldrellich Word VBA 3 03-24-2015 01:09 PM
Microsoft Word macro to find text, select all text between brackets, and delete helal1990 Word VBA 4 02-05-2015 03:52 PM
Select text between 2 Select section of text and change text newbieX Word VBA 3 03-28-2014 04:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft