Eric Penfold
Active Member
- Joined
- Nov 19, 2021
- Messages
- 431
- Office Version
- 365
- Platform
- Windows
- Mobile
This code finds first day in month but i need first working day i.e. 02/04 at the moment it returns 01/04.
VBA Code:
Function fwday(Optional givenDate As Variant) As Date
Dim d As Date
If IsMissing(givenDate) Then givenDate = Date
d = DateSerial(Year(givenDate), Month(givenDate), 1)
d = d + ((9 - (d Mod 7)) Mod 7)
fwday = d
End Function