Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    function for time... (2000 sr-1)

    why erro here:Application.WorkDay

    Option Explicit
    Sub uno()

    If Application.WorkDay(Date, 1) - 1 = Date Then
    ' giorno lavoro
    Else
    'giorno non lavoro
    End If


    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: function for time... (2000 sr-1)

    WORKDAY is not a standard worksheet function, it is part of the Analysis ToolPak add-in. To use this function in VBA, you need to do two things:
    1) Make sure that the check box for Analysis ToolPak - VBA is ticked (on) in Tools | Add-Ins..
    2) Set a reference to atpvbaen.xls in Tools | References... in the Visual Basic Editor.
    You can then use WorkDay (without Application):

    If WorkDay(Date, 1) - 1 = Date Then

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •