Re: Excel to notify date of birth

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On May 16, 10:40 am, sinecodap <sineco...@xxxxxxxxxxxx(donotspam)>
wrote:
I want to create a worksheet with Staff dates of birth and get a notification
(column on worksheet blinking in any colour) 3 days to the staff's birthday
date whenever i put on my system

A blinking column would require the use of a timer and would be a load
on your system. I would recommend going a different way. Maybe a
message box saying the employees name or something like that. A
simple For..Next statement could be used to loop through the employees
and determine if the birthday is within 3 days prior of the current
date.

Assuming the employee names begin in A2 and go down and their
associated birthday are in B2 and down, something like this would
work. Of course, it would probably be better to just display one
message box with all of the names listed.

Sub Auto_Open()
Dim i As Long
For i = 2 To Cells(65536, 1).End(xlUp).Row
If Date >= (Cells(i, 2).Value - 3) And _
Date <= Cells(i, 2).Value Then
MsgBox Cells(i, 1).Value
End If
Next i
End Sub

Or, you can highlight the person row instead of displaying a message
box.
Sub Auto_Open()
Dim i As Long
Cells.Interior.ColorIndex = xlNone
For i = 2 To Cells(65536, 1).End(xlUp).Row
If Date >= (Cells(i, 2).Value - 3) And _
Date <= Cells(i, 2).Value Then
Rows(i).EntireRow.Interior.ColorIndex = 40
End If
Next i
End Sub
.



Relevant Pages

  • RE: Storing birthdate with year optional
    ... Note that in years which are not a leap year the expression would evaluate ... to True on 1 March for anyone with a birthday on 29 February. ... Optional varDateAt As Variant) As Boolean ... year toy could list all employees whose birthday is today in a query along ...
    (microsoft.public.access.gettingstarted)
  • Re: OT Stranger than fiction...
    ... >>> chances of someone having the same birthday as you in a room with ... their birthday off. ... Just in case 2 employees in a workgroup had birthdays on the same date ... In my 5-person workgroup THREE of us shared the same date. ...
    (rec.outdoors.rv-travel)
  • How do I send birthday reminders to certain contacts?
    ... I am using 2003 outlook. ... all birthdays for employees. ... Reminders have been set for 2 weeks. ... that an employee's birthday is such an such date. ...
    (microsoft.public.outlook.general)
  • Re: Anniversery Dates
    ... based on Northwind's Employees table will return those ... employees whose birthday or hiring anniversary falls within the next 90 days. ... If I remove the criteria of> nowit displays everyone's anniversery date ... but I only want the ones within the flagdate ...
    (microsoft.public.access.queries)