View Single Post
 
Old 11-15-2014, 09:42 AM
rsrasc rsrasc is offline Windows 7 64bit Office 2010 64bit
Competent Performer
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

I would like to know if the below code can be modify for the following sequence of numbers in a document. For example:

1.
2.
3.
4.
5.

To start with any number:

To:

11.
12 .
13.
14.
15.

Or start with"

20.
21.
22.
23.
24.

Thanks!

PHP Code:
Sub Demo()
Application.ScreenUpdating False
Dim i 
As Long
CLng(InputBox("Starting#?"))
With ActiveDocument.Range
  With 
.Find
    
.ClearFormatting
    
.Replacement.ClearFormatting
    
.Text "Question #([0-9]@) \(ACCCC*\)"
    
.Replacement.Text ""
    
.Forward True
    
.Wrap wdFindStop
    
.Format False
    
.MatchWildcards True
    
.Execute
  End With
  
Do While .Find.Found
    
.Text Replace(.TextSplit(.Text" ")(1), "#" i)
    
1
    
.Collapse wdCollapseEnd
    
.Find.Execute
  Loop
End With
Application
.ScreenUpdating True
End Sub 
Reply With Quote