Hi,
as a novice I was able to find below code on the internet. It works great, it results in giving me the first Monday of the month. What do I need to change for the Function to return the first week or business day?
Any help is very much appreciated.
Public Function FirstMonday(Optional InputDate As Variant) As Date
Dim i As Integer
Dim dteTemp As Date
If IsMissing(InputDate) Or Not IsDate(InputDate) Then
dteTemp = DateAdd("m", 1, Date)
Else
dteTemp = DateAdd("m", 1, InputDate)
End If
For i = 1 To 7
dteTemp = DateSerial(Year(dteTemp), Month(dteTemp), i)
If Weekday(dteTemp) = vbMonday Then
FirstMonday = dteTemp
Exit For
End If
Next i
End Function
Bert,
Swansea, UK