+ Reply to Thread
Results 1 to 5 of 5

First of the year

  1. #1
    Oldjay
    Guest

    First of the year

    I have a macro that runs by a command buttom. I want it to check each time
    to see if it's after the first of the year, then display a warning message
    and not display the messag again until it detects a new year

    oldjay

  2. #2
    Jim Cone
    Guest

    Re: First of the year

    Why not just look at the calendar?
    --
    Jim Cone
    San Francisco, USA
    http://www.realezsites.com/bus/primitivesoftware

    "Oldjay" <[email protected]>
    wrote in message
    I have a macro that runs by a command buttom. I want it to check each time
    to see if it's after the first of the year, then display a warning message
    and not display the messag again until it detects a new year

    oldjay

  3. #3
    Norman Jones
    Guest

    Re: First of the year

    Hi OldJay,

    Try:

    '=============>>
    Private Sub CommandButton1_Click()
    On Error Resume Next
    If Evaluate("DateTrigger") < Year(Date) Then
    On Error GoTo 0

    MsgBox "Year Change!"
    Names.Add Name:="DateTrigger", _
    RefersTo:=Year(Date)
    End If

    'your Code e.g.:
    MsgBox "Hi"

    End Sub
    '<<=============


    ---
    Regards,
    Norman


    "Oldjay" <[email protected]> wrote in message
    news:[email protected]...
    >I have a macro that runs by a command buttom. I want it to check each time
    > to see if it's after the first of the year, then display a warning message
    > and not display the messag again until it detects a new year
    >
    > oldjay




  4. #4
    Oldjay
    Guest

    Re: First of the year

    People forget. That's why I need the code

    "Jim Cone" wrote:

    > Why not just look at the calendar?
    > --
    > Jim Cone
    > San Francisco, USA
    > http://www.realezsites.com/bus/primitivesoftware
    >
    > "Oldjay" <[email protected]>
    > wrote in message
    > I have a macro that runs by a command buttom. I want it to check each time
    > to see if it's after the first of the year, then display a warning message
    > and not display the messag again until it detects a new year
    >
    > oldjay
    >


  5. #5
    Oldjay
    Guest

    Re: First of the year

    Thanks

    "Norman Jones" wrote:

    > Hi OldJay,
    >
    > Try:
    >
    > '=============>>
    > Private Sub CommandButton1_Click()
    > On Error Resume Next
    > If Evaluate("DateTrigger") < Year(Date) Then
    > On Error GoTo 0
    >
    > MsgBox "Year Change!"
    > Names.Add Name:="DateTrigger", _
    > RefersTo:=Year(Date)
    > End If
    >
    > 'your Code e.g.:
    > MsgBox "Hi"
    >
    > End Sub
    > '<<=============
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Oldjay" <[email protected]> wrote in message
    > news:[email protected]...
    > >I have a macro that runs by a command buttom. I want it to check each time
    > > to see if it's after the first of the year, then display a warning message
    > > and not display the messag again until it detects a new year
    > >
    > > oldjay

    >
    >
    >


+ 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