Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Public Function ProjDate() As Date
  2. Dim d1 As Date, d2 As Date, y As Long
  3. Dim dd As Date, d As Long, m As Long
  4.  
  5. d = Day(Date)
  6. m = Month(Date)
  7. y = Year(Date)
  8. d1 = DateSerial(y, m + 18, d + 1)
  9. d2 = DateSerial(y, m + 24, d - 1)
  10.  
  11. For dd = d1 To d2
  12. d = Day(dd)
  13. m = Month(dd)
  14. If (m = 3 And d = 31) Or (m = 9 And d = 30) Then
  15. ProjDate = dd
  16. Exit Function
  17. End If
  18. Next dd
  19. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement