![]() |
#1
|
|||
|
|||
![]()
Hello people,
I need help with the date field to calculate a future date and that it would skip weekends and holidays. I was reading through several forums and tutorials and found out that it's surprisingly complex. I have no idea how to make this. The idea is as follows: Today's date = January 21, 2016 - I need the date to be 3 days in the future while excluding the weekend and let's imagine that there is also a holiday on Monday next week. The calculated date then would be January 27, 2016 - of course the code in the field would have to take into account the number of days in each month to smoothly go to the next month. The date would be calculated each time the document is opened. From what I've seen so far I understand that such thing is quite complex and I'm not even sure it works this way. Is there anyone who could help me with this? The best would be if someone attached a word document with this field already coded and I would just save it to copy it in all the documents. Thanks in advance for any ideas ![]() |
#2
|
||||
|
||||
![]()
To see how to do this and just about everything else you might want to do with dates in Word, check out my Microsoft Word Date Calculation Tutorial, at:
http://windowssecrets.com/forums/sho...ation-Tutorial or: http://www.gmayor.com/downloads.htm#Third_party In particular, look at the item titled Handling Weekends and Holidays in Calculated Dates. Do read the document's introductory material.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Hi,
Thank you for the prompt reply. I have read these tutorials and articles but I just can't get it to work. To be honest I have no idea how to properly modify the code. I spent a few hours on it and with no satisfactory results. I was just thinking if it would be possible to create the field with the requirements from my original post included and post it here? |
#4
|
||||
|
||||
![]()
The tutorial already contains fully-working field codes. All you need do is copy the 'Following Monday' version and change the 'Delay' value to 3. Hardly a task that warrants me doing the work for you...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]() Quote:
Just play around with it and you'll be surprised at what you can do. This is a user-to-user support forum to give people assistance. It is structured on the idea of giving someone a fishing pole and teaching them to fish rather than catching the fish for them. |
#6
|
|||
|
|||
![]()
You wouldn't believe it but it doesn't change anything. I also tried modifying the date format to be just Month day, year but the thing just stays the same.
What exactly does the QUOTE command does in the code? Is there something that needs to be connected missing? |
#7
|
|||
|
|||
![]() Quote:
Thanks for guiding me and for providing the links. Please close the thread. I got the answer ![]() |
#8
|
||||
|
||||
![]() Quote:
It serves as a wrapper to ensure the others update as a group. It would be no good to update just one of the fields in the construction. It also provides the context for the switches that format the output.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Excel pivot table with a DATE value field for some reason stops at a certain date | angie450 | Excel Programming | 2 | 08-19-2014 08:50 AM |
Adding text before a date merge field AND fomatting date as well | NikkiR | Mail Merge | 1 | 08-06-2014 07:18 PM |
Date field inserting merge date in blank field | Lesley | Mail Merge | 5 | 09-30-2013 01:49 AM |
![]() |
cosmopolitan | Word VBA | 1 | 08-14-2013 01:58 PM |
![]() |
Erbwon | Word | 6 | 11-12-2012 06:17 PM |