Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-24-2025, 09:27 PM
macropod's Avatar
macropod macropod is offline How to Use Wildcards to Find Specific Text Patterns  with sub-levels Windows 10 How to Use Wildcards to Find Specific Text Patterns  with sub-levels Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,526
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

.Text = "[0-9].[0-9a-z\(\)]{1,}"

Code:
Sub Demo()
Application.ScreenUpdating = False
Options.DefaultHighlightColorIndex = wdYellow
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "[0-9].[0-9a-z\(\)]{1,}"
    .Replacement.Highlight = True
    .Replacement.Text = "^&"
    .Wrap = wdFindContinue
    .MatchWildcards = True
    .Forward = True
    .Format = True
    .Execute Replace:=wdReplaceAll
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Use Wildcards to Find Specific Text Patterns  with sub-levels Find and replace text in a document with wildcards in vba marcotte974 Word VBA 2 06-22-2022 10:38 PM
How to Use Wildcards to Find Specific Text Patterns  with sub-levels VBA Find and Replace for sub levels Shelley Lou Word VBA 2 06-21-2021 12:45 AM
How to Use Wildcards to Find Specific Text Patterns  with sub-levels find/replace all text not a specific colour? LQuinn Word VBA 3 04-06-2021 04:51 PM
How to Use Wildcards to Find Specific Text Patterns  with sub-levels Find and replace text with wildcards arunchandar9 Word VBA 15 06-30-2019 01:06 AM
Using wildcards how do I Find and Add to, not replace Stargehzer Word 3 01-25-2016 09:14 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:46 PM.


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