+ Reply to Thread
Results 1 to 4 of 4

Macro for working days

  1. #1
    Registered User
    Join Date
    09-29-2016
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    2

    Macro for working days

    Hello All,
    I am looking for a macro which can calculate working days in a given month from start end date excluding weekend and company holidays

    Thanks,
    Monika

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Macro for working days

    Have a look at NETWORKDAYS function
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Registered User
    Join Date
    09-29-2016
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    2

    Re: Macro for working days

    tried that but that is not helping me to get values. Hoildays are in another sheet.

    This is my code.

    Sub date_macro()
    Dim StartDate As Date, EndDate As Date
    Dim Mon As Long
    Dim wd As Long

    Mon = InputBox("Enter the month as an number (EX. If you want to enter for January then enter 1).", "Info", "99")

    StartDate = DateSerial(2012, Mon, 1)
    EndDate = DateSerial(Year(StartDate), Month(StartDate) + 1, 0)


    wd = Application.WorksheetFunction.NetworkDays(StartDate, EndDate)

    End Sub

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Macro for working days

    Please, use CODE tags around your code

+ 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. [SOLVED] Count 6 working days (excluding Sunday, Holidays & half days)
    By eve_star1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-29-2015, 08:00 AM
  2. Calculate total working days and excepted leave days
    By megaiooo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-21-2013, 09:29 AM
  3. Working with Dates, VB MAcro to Auto Filter on last 7 days
    By Rikkdh in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-20-2013, 10:01 AM
  4. Show days in a month dynamically + working days
    By vemix in forum Excel General
    Replies: 5
    Last Post: 12-28-2012, 07:54 AM
  5. Help Working Out Relative Dates and Non Working Days
    By leungf in forum Excel General
    Replies: 0
    Last Post: 08-07-2012, 12:06 PM
  6. Previous working days date (Mon-Fri working week).
    By intothewild in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2011, 01:00 PM
  7. Excel 2007 : Converting days to working days
    By poboy2214 in forum Excel General
    Replies: 5
    Last Post: 02-18-2010, 01:22 PM

Tags for this Thread

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