![]() |
|
#1
|
||||
|
||||
![]() Here is a shorter option which works for me and applies the red colour as you requested. Code:
Sub Repl_Digits_W__Wds_3() 'In selected paragraphs, replace the digits that start tabbed paras with wds. Dim para As Paragraph, dgt As Range, arrText() As String arrText = Split("zero one two three four five six seven eight nine", " ") For Each para In Selection.Range.Paragraphs If para.Range.Text Like vbTab & "[0-9] *" Then 'Search for only single digits: Set dgt = para.Range.Characters(2) dgt.Text = arrText(dgt.Text) dgt.Font.ColorIndex = wdRed End If Next para End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#2
|
|||
|
|||
![]()
Guessed, your code is the best solution, I think! And your "[0-9] *" is brilliant! I live and learn.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't find and replace (Appendix + any number) | Muse1 | Word | 1 | 12-30-2023 08:36 AM |
![]() |
karkey | Word VBA | 2 | 08-02-2022 03:04 PM |
Find/Replace using format of cell | catflap | Excel | 1 | 09-11-2017 07:28 AM |
![]() |
Allen | Word | 5 | 11-20-2014 10:33 PM |
![]() |
winningson | Word | 3 | 01-19-2013 05:38 AM |