A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

add a date without holidays



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 21st 10, 08:30 PM posted to microsoft.public.outlook.program_vba
Christian W
external usenet poster
 
Posts: 6
Default add a date without holidays

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  
Old May 22nd 10, 06:23 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default add a date without holidays



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  
Old May 27th 10, 11:43 PM posted to microsoft.public.outlook.program_vba
Christian W
external usenet poster
 
Posts: 6
Default add a date without holidays

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 05:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.