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
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
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
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
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
>
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
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks