this seems to work on the dates I tried....thanks for your patience...
Sub testing()
Dim RtnVal As Integer, DayDelta As Integer
Dim Curdate As Date
RtnVal = InputBox("Enter number of days")
Curdate = Cells(ActiveCell.Row, ActiveCell.Column).Value
DayDelta = Weekday(Curdate + RtnVal) + Weekday(Curdate)
RtnVal = RtnVal + 2 * Int((Curdate + RtnVal - Curdate) / 5)
If DayDelta > 10 Then
RtnVal = RtnVal + 2
End If
If Weekday(Curdate + RtnVal, vbMonday) = 6 Then
Cells(ActiveCell.Row, ActiveCell.Column).Value = Curdate + RtnVal + 2
ElseIf Weekday(Curdate + RtnVal, vbMonday) = 7 Then
Cells(ActiveCell.Row, ActiveCell.Column).Value = Curdate + RtnVal + 1
Else
Cells(ActiveCell.Row, ActiveCell.Column).Value = Curdate + RtnVal
End If
End Sub
Bookmarks