Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default First of the year

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

"Oldjay"
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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" 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default 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"
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default 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" 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert day of year to numeric value format year+day in 4 digits Kaaren Excel Worksheet Functions 3 February 7th 09 08:37 PM
How do I crate a function for week of year + year in same cell. patty ann Excel Worksheet Functions 1 March 16th 08 06:34 PM
Combination Graph with current year and prior year sales JanW Charts and Charting in Excel 2 April 5th 07 09:20 PM
trying to get day/month/year froamt while user enters year only RADIOOZ New Users to Excel 3 June 7th 06 05:30 AM
How to compare current year to prior year in bar chart? substring Charts and Charting in Excel 4 May 12th 05 07:04 PM


All times are GMT +1. The time now is 06:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"