Function Count Weekdays

*** Function Count Weekdays ***

This function will generate a number of working days or weekdays from two dates. It counts from a start date to the end date excluding the weekend. This function counts or includes the Start Date.

VB Code:

count weekdays code

How to Use It:

#1 Create a form with the Start Date and End Date

#2 Add a textbox and names it as “txtNumber”

#3 Add a button “Get Weekdays”

design form

#4 Add Function code on form

#5 Call a function under the click button of “Get Weekdays”

code function

#6 On form view, enter date 6/1/2016 for a Start Date

#7 Enter date 6/7/2016 for End Date

#8 Click on Get Weekdays

#9 The result of working days will be “5” which does not include Saturday and Sunday per calendar below.

date entry form june 2016

Related posts