Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Macro to Create New Date Tabs in Worksheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Macro to Create New Date Tabs in Worksheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Macro to Create New Date Tabs in Worksheet


Bob,

That helps however that does not include bank holidays, only weekends.

Thx

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Macro to Create New Date Tabs in Worksheet

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using worksheet template create tabs against customer list Neall Excel Worksheet Functions 0 June 4th 09 07:03 PM
How do I create a list (Word) of the names on Excel worksheet tabs PT[_2_] Excel Worksheet Functions 3 February 23rd 07 05:24 PM
create option to view worksheet tabs vertically nk Setting up and Configuration of Excel 1 May 11th 06 11:49 AM
How can Excel create a list of tabs on a worksheet? AliceNXLand Excel Discussion (Misc queries) 3 April 14th 05 05:23 PM
How can I create multiple rows of worksheet tabs in a workbook? kdzugan Excel Discussion (Misc queries) 1 March 8th 05 03:13 PM


All times are GMT +1. The time now is 09:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"