+ Reply to Thread
Results 1 to 2 of 2

Networkdays in VBA including holidays

  1. #1
    Registered User
    Join Date
    03-16-2006
    Posts
    81

    Networkdays in VBA including holidays

    I have 2 textbox's in a userform with different dates in each.

    What i want to do is enter the number or working days betwen the 2 dates in a 3rd userform textbox, but include a list of user defined bank holidays within the network days.

    Is it possible to do this in VBA?

    Thanks

  2. #2
    Registered User
    Join Date
    10-25-2006
    Posts
    54
    Hi

    You can do this by, first, making sure that the text-boxes return a date rather than text;
    startdate1=datevalue(txt_date1.value)
    enddate1=datevalue(txt_date2.value)
    basedays=enddate1-startdate1
    This then gives the base number of days

    If you then have input boxes for start and end dates of the user-defined holidays you can then subtract 1 value from the other;
    holstart1=datevalue(txt_date3.value)
    holend1=datevalue(txt_date4.value)
    holdays=holend1-holstart1

    totaldays=basedays-holdays

    txt_totaldays.value=totaldays

+ Reply to Thread

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