![]() |
#2
|
||||
|
||||
![]()
You could use something like:
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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Style in Use Macro-Need Help Optimizing Code | freda0255 | Word VBA | 4 | 08-04-2014 07:35 PM |
![]() |
OTPM | Project | 4 | 08-22-2013 01:33 PM |
Need Macro code for Outlook | gbaker | Outlook | 0 | 04-11-2013 10:29 AM |
![]() |
chefmate | Excel Programming | 1 | 08-26-2012 01:04 AM |
Excel 2007 - formula or macro/vba code required | wrighty50 | Excel Programming | 3 | 05-13-2012 02:24 PM |