+ Reply to Thread
Results 1 to 4 of 4

Auto name tabs with dates excluding weekends and holidays

  1. #1
    Registered User
    Join Date
    12-05-2013
    Location
    San Diego
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question Auto name tabs with dates excluding weekends and holidays

    I am trying to run a macro to put in the Month, Day, Year on each tab but I want it to exclude holidays and weekends. I am not a techie or anything but I would like to know how to do this. I have tried various vb codes but they don't exclude the weekends/holidays. Thanks

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Auto name tabs with dates excluding weekends and holidays

    I will move this to the VBA forum for you
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    08-11-2013
    Location
    leeds
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Auto name tabs with dates excluding weekends and holidays

    Ill give my ideas before someone more qualified has time to help...

    If you set a variable as format(date,"dddd") this will give you the DAY of the week, you can then use an if statement to avoid weekends. I would imagine holidays would need to be listed somewhere as reference.

    Hope this helps

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Auto name tabs with dates excluding weekends and holidays

    See the attached worksheet that should do what you want.
    It is more involved than I had hoped, since I wasn't able to (i.e. I am not skilled enough) to adapt the Excel 'Workday()' function to my needs.

    Lewis

    The code in the worksheet follows:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 13
    Last Post: 07-20-2016, 02:05 AM
  2. [SOLVED] Calulating Time Between Two Dates/Times but Excluding Weekends and Holidays
    By randers1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2013, 10:24 AM
  3. VBA - List Dates excluding Weekends and Holidays
    By tykhoo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2012, 11:13 PM
  4. Replies: 7
    Last Post: 01-11-2011, 06:26 AM
  5. List Dates Excluding Holidays but Including weekends
    By GuyHudson in forum Excel General
    Replies: 6
    Last Post: 09-22-2010, 05:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1