Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have numerous workbooks and every day the latest worksheet has to be
copied and the date changed on the tab (with most recent always on the left). The procedure is right click on tab, move or copy, create a copy, right click, rename to prior business day. The dates are not neccessarily sequential as they follow normal business days for corporate offices of banks, e.g., excluding weekends and established holidays. The format for the dates is the month hyphen day with no leading zeros, like this "9-1" or "10-12". My current worksheet reads on the tabs as follows: 9-18, 9-15, 9-14, 9-13, 9-12, 9-11, 9-8, 9-7, 9-6, 9-5, 9-1. If a macro were made to generate a new tab on command would it be efficient to reference a table of bank dates? I would create a table of valid dates for the entire year. Thanks again, I always get great answers here. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No need to hold a table of dates, just use something like
myDate = date -1 If Weekday(myDate) =1 Then myDate = myDate -2 ElseIf Weekday(myDate) = 7 Then myDate = myDate -1 End If -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) wrote in message oups.com... I have numerous workbooks and every day the latest worksheet has to be copied and the date changed on the tab (with most recent always on the left). The procedure is right click on tab, move or copy, create a copy, right click, rename to prior business day. The dates are not neccessarily sequential as they follow normal business days for corporate offices of banks, e.g., excluding weekends and established holidays. The format for the dates is the month hyphen day with no leading zeros, like this "9-1" or "10-12". My current worksheet reads on the tabs as follows: 9-18, 9-15, 9-14, 9-13, 9-12, 9-11, 9-8, 9-7, 9-6, 9-5, 9-1. If a macro were made to generate a new tab on command would it be efficient to reference a table of bank dates? I would create a table of valid dates for the entire year. Thanks again, I always get great answers here. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Bob, That helps however that does not include bank holidays, only weekends. Thx |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should cover the holidays, it assumes the holiday dates are ina named
range 'holidays' myDate = date -1 If Weekday(myDate) =1 Then myDate = myDate -2 ElseIf Weekday(myDate) = 7 Then myDate = myDate -1 End If If Not IsError(Application.Match(myDate, Range("holidays"), 0)) Then myDate = myDate - 1 End If -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) wrote in message ups.com... Bob, That helps however that does not include bank holidays, only weekends. Thx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using worksheet template create tabs against customer list | Excel Worksheet Functions | |||
How do I create a list (Word) of the names on Excel worksheet tabs | Excel Worksheet Functions | |||
create option to view worksheet tabs vertically | Setting up and Configuration of Excel | |||
How can Excel create a list of tabs on a worksheet? | Excel Discussion (Misc queries) | |||
How can I create multiple rows of worksheet tabs in a workbook? | Excel Discussion (Misc queries) |