+ Reply to Thread
Results 1 to 5 of 5

Thread: Date Pop-up

  1. #1
    Registered User
    Join Date
    01-18-2012
    Location
    Lagos
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    1

    Date Pop-up

    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.

  2. #2
    Registered User
    Join Date
    01-25-2012
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Date Pop-up

    @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

  3. #3
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: Date Pop-up

    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)

  4. #4
    Registered User
    Join Date
    01-25-2012
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Date Pop-up

    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!

  5. #5
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: Date Pop-up

    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)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0