wish to make a Birthday reminder!!

  • Thread starter Thread starter kiran1810
  • Start date Start date
K

kiran1810

hello all,
I am new to Excel programming. and as a start I wished to create a Bday
reminder where in one worksheet I will have all my friends names and
against them I will have their Birthdays written in DD-MM format. I
tried to write a VBA code to pick the date from the worksheet and check
it with the curent Date. this was the logic I thought to use.
But unfortunately I could retrieve the present date using NOW().....
can anyone help me or suggest me any code model for this kind of
application?
thanks in advance...
reagrds,
satya.
 
Kiran, I have a sheet set up for birthdays, if you want to take a look at it
let me know and I will send you a copy
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
If you want to use code try the following:

1. In cell D1 of your worksheet place the formula =today()
2. Place the following in the workbook open event under "ThisWorkbook"

Private Sub Workbook_Open ()
Dim FriendBDay As Date

With Sheets("Sheet1")
''''This assumes that you have the birthdays listed in Column A and your
friends' names in column B
FriendBDay = Application.WorksheetFunction.VLookup(.Range("D1"),
..Range("A:B"), 2, False)
End With

If FriendBDay <> "#N/A" Then
MsgBox "Today is " & FriendBDay & "'s birthday!"
End If
End Sub

This won't work if you have 2 or more friends who share the same birthday as
it will only return the first name it finds.
 
Think you will get an error if Vlookup fails. Have you tested this? It
worked for you when .Range("D1") was not found in column A?
 
Hadn't thought about that...

Thanks

Tom Ogilvy said:
Think you will get an error if Vlookup fails. Have you tested this? It
worked for you when .Range("D1") was not found in column A?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top