営業日の足し算
営業日を考慮して、指定日から指定日数後の日付を取得する関数を作成しました。
' 営業日の足し算 ' argDate - 基準日 ' argDay - 足し合わせる日数 ' 2006/11/05 根本 新規作成 Public Function U_BusinessDayAfter(argDate As Date, argDay As Integer) As Date Dim tmpDate As Date Dim count As Integer tmpDate = argDate count = 0 Do While count < argDay tmpDate = tmpDate + 1 If U_IsBusinessDay(tmpDate) Then count = count + 1 End If Loop U_BusinessDayAfter = tmpDate End Function
ここで、U_IsBusinessDay関数は以前作成した関数で、与えられた日付が営業日かどうかをチェックする関数です。