![]() |
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 |
#3
|
|||
|
|||
![]()
On Thu, 12 Jan 2006 18:23:08 -0700, Steve Roberts wrote in
microsoft.public.outlook.program_vba: I have a custom .oft form for vacations that I am trying to clculate the number of business days the person will be gone. This is my current formula that returns the total number of day fine but does not exclude the weekends.DateDiff("d",[StartDate],[EndDate]) + 1 Can someone point me in the right direction please. Calculate the absolute week number in VBA's idea of a calendar for both dates, subtract one from the other, multiply by 2 for weekends, subtract that from DateDiff. DateDiff("d", datStart, datEnd) + 1 _ - ((datEnd - Weekday(datEnd, vbMonday) - 1) / 7 _ - (datStart - Weekday(datStart, vbMonday) - 1) / 7) * 2 This doesn't account for public holidays. For that, you could use Set myExcel = Application.CreateObject("Excel.Application")" and use Networkdays() in a workbook which contains the holidays. -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
why the date changes on 4 emails? | Jack | Outlook Express | 9 | March 9th 06 12:17 AM |
I hate Outlook 2002. Can I go back to Outlook 2000? | eppkai | Outlook - Installation | 4 | February 12th 06 06:49 PM |
go to date quicker | yster | Outlook - Calandaring | 2 | February 11th 06 09:58 PM |
date fields - link the calander pop-up to a custom date field | Tom | Outlook - Using Forms | 0 | January 23rd 06 09:13 PM |
Exporting Date received and Date Sent to Access | Sugarthebeet | Outlook - General Queries | 1 | January 19th 06 08:06 PM |