Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2024, 08:35 AM
syl3786 syl3786 is offline Word macro wildcard issue Windows 10 Word macro wildcard issue Office 2019
Advanced Beginner
Word macro wildcard issue
 
Join Date: Jan 2023
Posts: 97
syl3786 is on a distinguished road
Default

Quote:
Originally Posted by vivka View Post
Unfortunately, I rarely work in Excel and I'm not a programmer, so I can suggest a Word code to illustrate using a range:


Code:
Sub Replace_Digits_With_Wds()

Dim oRng As range

Application.ScreenUpdating = False
Set oRng = ActiveDocument.range
    With oRng.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchWildcards = True
        .text = Chr(9) & "1([!0-9])"
        While .Execute
            oRng.End = oRng.End - 1
            oRng = Chr(9) & "-"
            oRng.Font.ColorIndex = wdBrightGreen
            oRng.Collapse wdCollapseEnd
        Wend
Application.ScreenUpdating = True
Set oRng = Nothing
End With
Thank you for sharing your suggestions. While I understand that you may not have extensive experience working with Excel or programming, I appreciate your input and willingness to contribute. I will take your suggestion into consideration and explore the possibility of incorporating a Word code that utilizes a range.
Reply With Quote
  #2  
Old 01-11-2024, 09:12 AM
vivka vivka is offline Word macro wildcard issue Windows 7 64bit Word macro wildcard issue Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Thank you, syl3786, for your kind words!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recording macro for Find Wildcard 2vbr Word VBA 3 09-21-2020 05:29 PM
Word macro wildcard issue Macro to highlight wildcard phrase, copy and paste into new doc. MaryTom Word VBA 2 05-18-2018 04:23 PM
Issue with wildcard search mysterytramp Word 0 05-13-2015 10:40 AM
Issue with Wildcard Search and Replace linusthedog Word 3 09-04-2014 03:32 PM
Change characters outside a wildcard while keeping wildcard results nymusicman Word VBA 2 04-10-2014 08:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:22 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