![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi friends,
I have a problem, in a macro I need to calculate a date adding working days only. This add not include saturday / sundays and holidays. For example: 21/5 + 6 days = 31/5 How i can to do ? Thanks in advance and sorry by my english, Christian |
Ads |
#2
|
|||
|
|||
![]() For adding days, use the DateAdd function. It won't return an invalid date like 31/5. The Weekday function returns the number of the day, for instance this Weekday("22.05.2010" ,vbUseSystemDayOfWeek) returns 6 for Saturday, tomorrow it will return 7 for Sunday. For holidays I can't help off head. -- Best regards Michael Bauer - MVP Outlook Category Manager - Easily share your categories: SAM - Automatically choose sending account, signature, and sent message folder: http://www.vboffice.net/product.html?lang=en Am Fri, 21 May 2010 11:30:01 -0700 schrieb Christian W: Hi friends, I have a problem, in a macro I need to calculate a date adding working days only. This add not include saturday / sundays and holidays. For example: 21/5 + 6 days = 31/5 How i can to do ? Thanks in advance and sorry by my english, Christian |
#3
|
|||
|
|||
![]()
Michael,
yes, this function add dates, but i need to add 7 working days, but this function add working days and non working days. How i can only add working days without saturday and sunday ? For example : 26/5/2010 + 7days = 4/6/2010 (not contain saturday and sundays) Sorry my english.. Thanks in advance. Christian "Michael Bauer [MVP - Outlook]" wrote: For adding days, use the DateAdd function. It won't return an invalid date like 31/5. The Weekday function returns the number of the day, for instance this Weekday("22.05.2010" ,vbUseSystemDayOfWeek) returns 6 for Saturday, tomorrow it will return 7 for Sunday. For holidays I can't help off head. -- Best regards Michael Bauer - MVP Outlook Category Manager - Easily share your categories: SAM - Automatically choose sending account, signature, and sent message folder: http://www.vboffice.net/product.html?lang=en Am Fri, 21 May 2010 11:30:01 -0700 schrieb Christian W: Hi friends, I have a problem, in a macro I need to calculate a date adding working days only. This add not include saturday / sundays and holidays. For example: 21/5 + 6 days = 31/5 How i can to do ? Thanks in advance and sorry by my english, Christian . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
click date/time field display calendar and validation of date /tim | Smithskenpo | Outlook - Using Forms | 0 | March 4th 10 09:20 PM |
need help with vba code to input data on certain date and move to next cell for the following date. | [email protected] | Outlook and VBA | 1 | May 30th 07 05:45 PM |
Calcualting the time between email received date and reply date | Shanks | Outlook - General Queries | 3 | February 22nd 07 04:11 AM |
Appointments display on date entered rather than date/time schedul | MaxRPeterson | Outlook - Calandaring | 0 | November 28th 06 05:49 PM |
date fields - link the calander pop-up to a custom date field | Tom | Outlook - Using Forms | 0 | January 23rd 06 10:13 PM |