![]() |
|
#1
|
|||
|
|||
![]()
Someone may be allow with a simplified find and replace, but it is late here:
Code:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey Dim oPar As Paragraph, oRng As Range For Each oPar In ActiveDocument.Range.Paragraphs Select Case Trim(oPar.Range.Words.First) Case "Sunday", "Monday", "Friday" Select Case True Case IsNumeric(oPar.Range.Words.Last.Previous) Set oRng = oPar.Range.Words.Last.Previous oRng.MoveStart wdCharacter, -3 If IsNumeric(oRng) Then oPar.Style = "Body Text" 'Define some style you want to apply. End If End Select End Select Next oPar lbl_Exit: Exit Sub End Sub |
#2
|
|||
|
|||
![]() Quote:
|
![]() |
Tags |
formatting, regex |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
aolszewski | Word VBA | 3 | 11-23-2013 02:07 AM |
![]() |
zdodson | Word VBA | 1 | 07-11-2013 04:53 PM |
![]() |
bertietheblue | Word VBA | 9 | 07-01-2013 12:39 PM |
![]() |
redhin | Word VBA | 5 | 03-05-2013 05:42 AM |
![]() |
RBLampert | Word VBA | 13 | 10-23-2012 04:45 PM |