Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-29-2012, 11:00 AM
tchase01 tchase01 is offline Macro for tomorrow's Date Windows 7 64bit Macro for tomorrow's Date Office 2007
Novice
Macro for tomorrow's Date
 
Join Date: Feb 2012
Posts: 2
tchase01 is on a distinguished road
Post Macro for tomorrow's Date

I am trying to figure out how to build a macro to use Find and Replace to look for specific text and replace that text with tomorrow's date.

Look for: datez


replacement: yyyymmdd
which needs to be tomorrow's date.

Any help would be appreciated.

Thanks
tchase01
Reply With Quote
  #2  
Old 03-01-2012, 01:59 AM
macropod's Avatar
macropod macropod is offline Macro for tomorrow's Date Windows 7 64bit Macro for tomorrow's Date Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
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

Hi tchase01,

This requires far more than a simple Find/Replace, with you can't automatically add '1' to whatever the found string is. Furthermore, your datez Find string would have to be in a specified format, which you haven't told us the details of (is it yyyymmdd?).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-01-2012, 06:41 AM
tchase01 tchase01 is offline Macro for tomorrow's Date Windows 7 64bit Macro for tomorrow's Date Office 2007
Novice
Macro for tomorrow's Date
 
Join Date: Feb 2012
Posts: 2
tchase01 is on a distinguished road
Default Macro for tomorrow's Date

Here is an example of what I am trying to do below, search for the 'datezzz' and replace it with the following days date '20120302'. I have many articles in one file that i need to make this change to. I am using Word 2007. The datezzz format is just text, but I need it to be a date in text format 'yyyymmdd' as in the examples below:

Original

<article>
<filename>article.xml</filename>
<timestamp>04:00:27</timestamp>
<pubdate>datezzz</pubdate>
<section>Business</section>
<taxonomy>13</taxonomy>
<keyword></keyword>


Replacement

<article>
<filename>article.xml</filename>
<timestamp>04:00:27</timestamp>
<pubdate>20120302</pubdate>
<section>Business</section>
<taxonomy>13</taxonomy>
<keyword></keyword>


Thanks for looking and trying to help!!!!
Reply With Quote
  #4  
Old 03-01-2012, 04:03 PM
macropod's Avatar
macropod macropod is offline Macro for tomorrow's Date Windows 7 64bit Macro for tomorrow's Date Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
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

Hi tchase01,

You don't really need a macro to replace 'datezzz' with tommorrow's date in YYYYMMDD format. You can do that with an ordinary Find/Replace, for which you can replace 'datezzz' with any YYYYMMDD string of your choice.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
date, find and replace, macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for tomorrow's Date Meaning of current date vs status date when saving baselines ketanco Project 1 02-08-2012 02:20 PM
Macro for tomorrow's Date need help with macro date and time for dispatch sheets Jamesb8488 Word 1 04-28-2011 02:54 PM
Macro date and match valor cg1980 Excel Programming 0 04-12-2011 09:38 AM
Macro for tomorrow's Date Need urgent help .. lost 6 hours of work .. assignments due in tomorrow Phatmat Word 1 10-15-2009 08:38 AM
Macro for tomorrow's Date Imported message date change to today's date promark Outlook 1 12-23-2005 07:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:26 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