![]() |
#6
|
||||
|
||||
![]()
The macro equivalent of the wildcard Find/Replace is:
Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range .InsertBefore vbCr With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "^13[0-9]{1,}.^32" .Replacement.Text = "^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchWildcards = True .Execute Replace:=wdReplaceAll End With While .Characters.First = vbCr .Characters.First.Delete Wend End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
loop macro, vb, word 2013 lines |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
bracketandquotes | Word VBA | 17 | 02-16-2015 03:51 PM |
Save As Macro using first line of document as document name | redzan | Word VBA | 1 | 01-31-2015 09:24 PM |
![]() |
ilcaa72 | Word VBA | 4 | 02-13-2014 11:48 AM |
![]() |
Yamaha Rider | Word VBA | 2 | 02-07-2012 05:33 PM |
![]() |
Nano07 | Word VBA | 2 | 11-02-2011 05:14 AM |