Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-21-2014, 12:01 AM
macropod's Avatar
macropod macropod is offline Loop Macro to Edit Date Windows 7 32bit Loop Macro to Edit Date Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
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

In that case, only a few minor changes to the previous code are required, being nothing more that deleting the day parts of the date references:
Code:
...
StrRep = Format(DateAdd("d", -1, CDate(Month(Now()) & "/1/" & Year(Now()))), "MMMM YYYY")
...
      .Text = "[ADJMO][abceghlmnorstuy]{2,7} [12][0-9]{3}"
      .Execute Replace:=wdReplaceAll
      .Text = "February [12][0-9]{3}"
      .Execute Replace:=wdReplaceAll
      .Text = "[AJSN][beilmnoprtuv]{4,8} [12][0-9]{3}"
...
Indeed, all of:


Code:
      .Text = "[ADJMO][abceghlmnorstuy]{2,7} [12][0-9]{3}"
      .Execute Replace:=wdReplaceAll
      .Text = "February [12][0-9]{3}"
      .Execute Replace:=wdReplaceAll
      .Text = "[AJSN][beilmnoprtuv]{4,8} [12][0-9]{3}"
could be reduced to:
Code:
      .Text = "<[JFMASOND][a-ceg-il-pr-vy]{2,8} [12][0-9]{3}>"
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop Macro to Edit Date Loop Macro to Edit Date damaniam Word VBA 11 12-05-2013 08:28 AM
Loop Macro to Edit Date Macro to loop in Word Yamaha Rider Word VBA 2 02-07-2012 05:33 PM
Loop Macro to Edit Date WORD Macro - import picture - resize - position - page break - loop Nano07 Word VBA 2 11-02-2011 05:14 AM
Loop Macro to Edit Date Macro to loop in subfolders, change links, export xml data Catalin.B Excel Programming 2 09-08-2011 11:37 PM
Loop Macro to Edit Date 'Last edit date' markg2 Word 3 12-26-2010 04:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft