B
B
Breaking-cat2014-02-26 08:57:58
Macros
Breaking-cat, 2014-02-26 08:57:58

How to write a notification program using Excel?

Good afternoon.
There is Microsoft excel, in it the table. The table contains a list of employees of the organization with their dates of birth. It is necessary, using excel tools, to organize the issuance of notifications about DR. Is there such a possibility? And if it is, I will be glad to receive tips on this issue. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2014-02-26
@Breaking-cat

I thought a little (googled) - which I advise you. And here's what I wrote :).

' Private Sub Workbook_Open()
Sub Кнопка1_Щелчок()
Dim mess As String
' В столбце ДР проверить, есть ли дата совпадающая с сегодняшней
  For Each rCell In Range("A3:A6")
    If rCell.Value <> "" Then
      If (Day(rCell.Value) = Day(Date)) And (Month(rCell.Value) = Month(Date)) Then
        ' MsgBox Cells(rCell.Row, rCell.Column + 1).Value
        mess = mess + Cells(rCell.Row, rCell.Column + 1).Value + " "
      End If
    End If
  Next
  If mess <> "" Then MsgBox "Поздравляем " + mess + "!"
End Sub

To work when opening a file, replace Sub Button1_Click() with Private Sub Workbook_Open()
File Link

R
Roman, 2014-02-26
@gen1s

You can do the following. In VBA, write a book open event handler in which to run through the list of employees and compare whether the date of birth matches the current date. If it matches, then perform some action (show a message, send an email).
All this is written in 5 minutes.
Minus. You will need to periodically open this workbook in Excel (the handler only fires when it is opened). For example, you can throw in autoload.
Do you need Excel tools? After all, you can use some kind of calendars (Google Calendar, in Outlook, etc.).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question