ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Public Holidays (https://www.excelbanter.com/excel-programming/374258-public-holidays.html)

missk

Public Holidays
 
Hi,

Please help.

Currently I have a formula in my macro with the below logic.

If today is workday (Mon) then = today -3
If today is workday (Tues to Friday) then = today-1
If today is Weekend (Sat) then = today - 1
If today is Weekend (Sun) then = today -2

The problem I have is when there's a public holiday.

How do I account for a public holiday? How can I store the public
holidays within the macro?

Thank you.


Dave Peterson

Public Holidays
 
Maybe you could just use =workday() from the analysis toolpak (tools|addins to
install it).

And you could put the holidays in a column on a (hidden?) worksheet.

(Maybe you won't need a macro.)

But you could store the list of holidays on a worksheet and still use them in
your code, too.

missk wrote:

Hi,

Please help.

Currently I have a formula in my macro with the below logic.

If today is workday (Mon) then = today -3
If today is workday (Tues to Friday) then = today-1
If today is Weekend (Sat) then = today - 1
If today is Weekend (Sun) then = today -2

The problem I have is when there's a public holiday.

How do I account for a public holiday? How can I store the public
holidays within the macro?

Thank you.


--

Dave Peterson


All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com