Hi, please i need information on how to create a Date reminder that popup in Microsoft Excel e.g. my son's birthday. Thank you.
@Ibk -
Not sure where/how you're trying to implement this code, but here is what I came up with for you:
It'd probably be best to have this routine in the Workbook_Open event, so that you don't have to press a button anywhere. This way it'll fire automatically when you open the workbook (assuming you have your Trust Center settings enabling macros automatically).
Sub BirthdayReminder() Dim d As Integer Dim m As Integer Dim cd As Integer Dim cm As Integer Dim cy As Integer Dim i As Integer Dim s As String cd = Day(Now()) 'current day cm = Month(Now()) 'current month cy = Year(Now()) 'current year d = 25 'day of his birthday m = 2 'month of his birthday If m = cm Then If d = cd Then s = MsgBox("Today is your son's Birthday!!", vbOKOnly, "Birthday Reminder") Exit Sub End If End If If m < cm Then y = Year(DateAdd("yyyy", 1, Now())) Else i = DateDiff("d", Now(), DateSerial(y, m, d)) s = MsgBox(i & " days remaining until your son's birthday.", vbOKOnly, "Birthday Reminder") End If End Sub
Last edited by ww1711; 01-25-2012 at 01:00 PM. Reason: Placed Exit Sub in wrong If statement
I wouldn't automatically have macros enabled!!!!
You could list specific dates like birthdays then use Conditional Formatting to highlight them
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Then don't have them enabled automatically. When you open Excel, just enable macros. Wasn't aware of the sin I obviously committed by writing that.![]()
If you my posts help you, click the star icon!
Nobody suggested a sin, just bad security advice
Here's a Calendar with reminders
ACADEMIC_CALENDAR(1).xlsm
Last edited by royUK; 01-26-2012 at 03:06 AM.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks