Sub Test()
Dim dte As Date, dtR As Date
Dim dist As Integer
Dim wkd As Integer
'supply
Range("E12").Value = Date
Range("G12").Value = 11
'output
Range("B13").Value = Working_Days(Range("E12"), Range("G12"), 1)
'
Range("B15").Value = Working_Days("02.02.2019", 11, 1)
'
dte = Date: dist = 15: wkd = 1
dtR = Working_Days(dte, dist, 1)
MsgBox dtR
End Sub
Private Function Working_Days(dStart As Date, intD As Integer, intI As Integer) As Date
Working_Days = WorksheetFunction.WorkDay_Intl(dStart, intD, intI)
End Function
|