Thread: [Solved] Loop Macro to Edit Date
View Single Post
 
Old 12-04-2013, 01:01 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try changing:
StrRep = InputBox("What is the replacement text?")
to:
StrRep = Format(DateAdd("d", -1, CDate(Month(Now()) & "/1/" & Year(Now()))), "MMMM D, YYYY")
and, at the end of each '.Text = ' line, before the final double quotes, insert:
, [12][0-9]{3}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote