Thread: Work out the 4th monday of the Month

Join Date
Feb 2004
Location
New Zealand
Posts
1,482

Unanswered: Work out the 4th monday of the Month

Has Any one got a formula to do this

2. www.gvee.co.uk
Join Date
Jan 2007
Location
UK
Posts
11,445

Join Date
Feb 2004
Location
New Zealand
Posts
1,482
Thanks Georgev

That what I wanted thats 2 easy

Join Date
Feb 2004
Location
New Zealand
Posts
1,482
Here it is

Code:
```Function NextDate(nmonth, nTh, myday)
'*************************************************
'thanks to
'http://michaelthompson.org/technikos/holidays.php
'*************************************************
Select Case myday
Case "Mon"
nTargetday = 2
Case "Tue"
nTargetday = 3
Case "Wed"
nTargetday = 4
Case "Thu"
nTargetday = 5
Case "Fri"
nTargetday = 7
Case "Sat"
nTargetday = 0
Case "Sun"
nTargetday = 1
End Select
nyear = Year(Date)
nEarliestDate = 1 + 7 * (nTh - 1)
nWeekday = Weekday(DateValue(nEarliestDate & "/" & nmonth & "/" & nyear), vbSunday)
If nWeekday = nTargetday Then
noffset = 0
ElseIf nTargetday < nWeekday Then
noffset = nTargetday + (7 - nWeekday)
Else
noffset = (nTargetday + (7 - nWeekday)) - 7
End If
nextD = nEarliestDate + noffset & " " & MonthName(nmonth, True) & " " & nyear
NextDate = nextD
End Function```

<% =NextDate(Month(Date), 4, "Mon") %>

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•