View Single Post
 
Old 06-12-2015, 07:05 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote