![]() |
#1
|
|||
|
|||
![]() Hi all. I am hoping someone can help me. I want to write a code that quality checks work to some degree. Firstly it needs to identify dates in format D MMMM YYYY if the date goes over a page break i would like it to highlight the date in yellow. If the date's year is in the future, highlight the date. any help would be appreciated: starting with this: Sub ChangeDateFormatWithReplaceCommand() Dim myMonth(1 To 12) As String myMonth(1) = "January" myMonth(2) = "February" myMonth(3) = "March" myMonth(4) = "April" myMonth(5) = "May" myMonth(6) = "June" myMonth(7) = "July" myMonth(8) = "August" myMonth(9) = "September" myMonth(10) = "October" myMonth(11) = "November" myMonth(12) = "December" For i = 1 To 12 Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "([0-9]{1,2})& ")" & "(" & myMonth(i)" .Replacement.Text = "?"" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = True .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Next i End Sub Thanks |
Tags |
date |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Require assistance in writing code to login to webmail account. | saurabhlotankar | Excel Programming | 4 | 05-21-2015 10:47 AM |
Assistance with Word 2010 If formula | ciresuark | Word | 1 | 03-09-2015 12:57 PM |
![]() |
mpdsal | Word VBA | 8 | 09-11-2014 03:55 PM |
Code to add dates | terricritch | Excel Programming | 10 | 11-08-2011 09:51 AM |
find - reading highlight - highlight all / highlight doesn't stick when saved | bobk544 | Word | 3 | 04-15-2009 03:31 PM |