XLA routines: EE_PrevBusinessDay
EE_PrevBusinessDay takes a date, and a holiday calendar and returns the previous business day.
Function EE_PrevBusinessDay(rngHolidays As range, dt As Date) As Date 'Takes a date, a range of holidays, and returns the previous business day Dim intPvs As Integer Dim dtPvs As Date 'http://excelexperts.com/xla-routines-eePrevBusinessDay for updates on this function intPvs = 1 Do While True dtPvs = DateAdd("d", 0 - intPvs, dt) If EE_IsBusinessDay(rngHolidays, dtPvs) Then EE_PrevBusinessDay = dtPvs Exit Function End If intPvs = intPvs + 1 Loop End Function
»
- Nick's blog
- Login or register to post comments
- 2589 reads
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago