David try this....

Public Function ufnWorkDays(StartDate As Date, intDays As Integer) As
Date


Dim iDays As Integer    'Day counter
Dim datTemp As Date     'Date variable

datTemp = DateAdd("d", intDays, StartDate)

'Add 1 if it is a Sunday
If Weekday(datTemp) = 1 Then
    datTemp = DateAdd("d", 1, datTemp)
End If


'Deduct 1 if it is a Saturday
If Weekday(datTemp) = 1 Then
    datTemp = DateAdd("d", -11, datTemp)
End If

ufnWorkDays = datTemp


End Function

--~--~---------~--~----~------------~-------~--~----~
Visit the blog to download Excel tutorials at 
http://www.excel-macros.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/excel-macros?hl=en

Visit & Join Our Orkut Community at 
http://www.orkut.com/Community.aspx?cmm=22913620

Visit the blog to download Excel tutorials at 
http://www.excel-macros.blogspot.com

To Learn VBA Macros Please visit http://www.vbamacros.blogspot.com

To see the Daily Excel Tips, Go to:
http://exceldailytip.blogspot.com
-~----------~----~----~----~------~----~------~--~---

Reply via email to