Results 1 to 12 of 12

How to use Workday function using vba?

Threaded View

laxminarayana How to use Workday function... 01-27-2014, 10:52 AM
Ron Coderre Re: How to use Workday... 01-27-2014, 11:48 AM
laxminarayana Re: How to use Workday... 01-29-2014, 10:12 AM
laxminarayana Re: How to use Workday... 02-01-2014, 03:08 AM
Ron Coderre Re: How to use Workday... 02-01-2014, 08:34 AM
laxminarayana Re: How to use Workday... 02-01-2014, 09:53 AM
Ron Coderre Re: How to use Workday... 02-01-2014, 11:41 PM
laxminarayana Re: How to use Workday... 02-04-2014, 01:02 PM
  1. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to use Workday function using vba?

    Got it....The WORKDAY function only counts actual workdays. However, it seems that you want to count actual days, including weekends, but not including holidays? Is that the rule?

    EDITED:
    I deleted my previous misguided effort because I think I figured out what you want.
    This code begins with the reference date, adds 3, then finds the next workday after that.
    Sub autotext()
    Dim ws1 As Worksheet
    Dim ws2 As Worksheet
    Dim ws3 As Worksheet
    Dim HolidayRange As Range
    Dim dtMyDate As Date
    
    Set ws1 = Sheets("Data")
    Set ws2 = Sheets("Actual")
    Set ws3 = Sheets("HolidaysList")
    Set HolidayRange = Worksheets("HolidaysList").Range("A1:A13")
    
    dtMyDate = WorksheetFunction.WorkDay(ws1.Range("B2") + 3, 1, HolidayRange)
    
    ws2.Range("D1").Value = "Please send the file on " _
                            & Format(dtMyDate, "mm/dd/yyyy")
    
    End Sub


    Is that something you can work with?
    Last edited by Ron Coderre; 02-04-2014 at 01:31 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Workday function help
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-10-2013, 08:47 AM
  2. Workday.INTL or Workday function issue
    By junoon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2013, 03:14 PM
  3. Workday function
    By Saky in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-31-2011, 09:56 AM
  4. Is there a better WORKDAY function?
    By Stubrok in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-19-2010, 04:45 PM
  5. [SOLVED] Workday function
    By RUSH2CROCHET in forum Excel General
    Replies: 4
    Last Post: 05-17-2006, 02:40 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