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
i = 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(.Text, Split(.Text, " ")(1), "#" & i)
i = i + 1
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
End Sub