How do I adapt the following or what code could I use so that weekends are ignored in calculating future dates? For example: If the user selects April 11 from the calendar control as the FirstDate and wants to know the date 5 business (weekday)days from that date how would this be accomplished?
I'm also trying to ignore holidays (I have a holiday table).
Private Sub Command14_Click()
Dim FirstDate As Date 'Declare variables
Dim IntervalType As String
Dim Number As Integer
Dim Msg
IntervalType = "d" '"d" specifies months as interval
FirstDate = Calendar1
Number = InputBox("Enter number of days to add")
Msg = "New date: " & DateAdd(IntervalType, Number, FirstDate)
MsgBox Msg
Exit_Command14_Click:
Exit Sub
End Sub
I'm also trying to ignore holidays (I have a holiday table).
Private Sub Command14_Click()
Dim FirstDate As Date 'Declare variables
Dim IntervalType As String
Dim Number As Integer
Dim Msg
IntervalType = "d" '"d" specifies months as interval
FirstDate = Calendar1
Number = InputBox("Enter number of days to add")
Msg = "New date: " & DateAdd(IntervalType, Number, FirstDate)
MsgBox Msg
Exit_Command14_Click:
Exit Sub
End Sub