Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-10-2024, 05:23 AM
vivka vivka is offline Find and replace the number format after vbTab Windows 7 64bit Find and replace the number format after vbTab Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Hi, syl3786! Or you can use:
Code:
Sub Repl_Digits_W__Wds_3()
'In selected paragraphs, replace the digits that start tabbed paras with wds.

Dim para As Paragraph
Dim dgt As range

Application.ScreenUpdating = False
    For Each para In selection.range.Paragraphs
'Search for only digits:
        If para.range.Characters(1) = Chr(9) And _
            para.range.Characters(2) Like "[0-9]" And _
            para.range.Characters(3) = Chr(32) Then
                Set dgt = para.range.Characters(2)
                Select Case dgt
                    Case "0"
                        dgt = "zero"
                    Case "1"
                        dgt = "one"
                    Case "2"
                        dgt = "two"
                    Case "3"
                        dgt = "three"
                    Case "4"
                        dgt = "four"
                    Case "5"
                        dgt = "five"
                    Case "6"
                        dgt = "six"
                    Case "7"
                        dgt = "seven"
                    Case "8"
                        dgt = "eight"
                    Case "9"
                        dgt = "nine"
                End Select
        End If
    Next para
Application.ScreenUpdating = True
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't find and replace (Appendix + any number) Muse1 Word 1 12-30-2023 08:36 AM
Find and replace the number format after vbTab find and replace with format 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
Find and replace the number format after vbTab Need Help to Find a Number and replace Allen Word 5 11-20-2014 10:33 PM
Find and replace the number format after vbTab Find and Replace maintain format winningson Word 3 01-19-2013 05:38 AM

Other Forums: Access Forums

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