Results 1 to 3 of 3

Create Macro to Calculate Workdays Between two Dates

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Create Macro to Calculate Workdays Between two Dates

    Hi,

    I want to calculate the Net Work Days between two dates as well as excluding holidays between those two dates. I created a holiday list in a worksheet named "holidaylist" in the workbook "DosExample".

    I am able to do this using the following excel formula:
    =NETWORKDAYS(K2,L2,holidaylist!$A$2:$A:$A95)...K2 is the start date and L2 is the end date...and displaying the results in J2 through the rest of the cells. This formula works great and is exactly what I want, but since I could have up to 20,000 records I really don't want to copy and paste the formula for the rest of the cells.

    I want to use a macro that can populate the correct results in J2 and the rest of cells (the range can vary) by using the formula I described above.

    In the workbook attached to this post I have worksheets:
    1. holidaylist
    2. Data Before Macro is Executed
    3. Data After Macro is Executed

    If you need me to clarify something just let me know.

    - BC
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

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