Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-11-2024, 09:05 PM
syl3786 syl3786 is offline Seeking guidance on using Word macros to find and replace Arabic numbers after indent Windows 10 Seeking guidance on using Word macros to find and replace Arabic numbers after indent Office 2019
Advanced Beginner
Seeking guidance on using Word macros to find and replace Arabic numbers after indent
 
Join Date: Jan 2023
Posts: 97
syl3786 is on a distinguished road
Default Seeking guidance on using Word macros to find and replace Arabic numbers after indent


Hello everyone,

I hope this message finds you all well. I am currently working on a Word macro that aims to find and replace Arabic numbers specifically after an indent. Despite my efforts in searching through numerous forums and websites dedicated to Word macros, I have been unable to find relevant information to address my specific query.

I would like to share the Word macro I got from this forum thus far, which is intended to find and replace Arabic numbers following the Chr(9) character:

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

End Sub
If you have a moment to spare, I would be immensely grateful if you could provide me with some guidance on how to resolve the aforementioned issues. Your expertise and insights would be of great value to me.

Here attached the original document and expected result document for your references:

original document.docx
Expected result document.docx

Thank you kindly for taking the time to read my message and considering my request. I appreciate your assistance.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeking guidance on using Word macros to find and replace Arabic numbers after indent Potential Clashes in Macros - Seeking Assistance yanyan9896 Word VBA 2 10-09-2023 04:59 AM
Find/replace - symbol for all numbers or symbol letters (Word 97) Genericname1111 Word 10 11-10-2019 10:37 PM
Find and Replace Numbers Macro VBA in Microsoft Word Yotem189 Word VBA 3 09-20-2018 05:55 AM
Numbers format in word to arabic Mzbarca Word 1 02-28-2016 07:56 PM
Find and replace BETWEEN numbers WordUser2015 Word 4 12-19-2014 02:09 PM

Other Forums: Access Forums

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