How to sort the Outlook Calendar by Birthday

Last reviewed on January 17, 2014

Over the years, I've had a lot of questions from users who wanted to filter their birthday events. This article shows how to Create a custom view to list upcoming birthdays.

But what about sorting by month and day, as they will appear on the calendar?

For example, a contact's birthday is 11/18/1935. It shows up on the correct 2014 date in month/week/day view, but in the list view, it appears at the top of the list, because Outlook sorts by the serial value of the date when using a numerical date format. It won't appear at all if you filter for 2014 start dates, because the year is 1935.

If you want to see a list containing only birthdays, you need to filter for recurrence equals yearly, not the Start date. If you have a lot of yearly events on your calendar, assign a category to your birthday events and filter on that as well.
Filter for Recurrence equals yearly.

To create this filter, switch to a List view (on the View tab).

  1. Click the View Settings button, then Filter, and Advanced tab.
  2. Click on Field and select Recurrence from the Frequently used fields list or type recurrence in the box beneath Field.
  3. Select equals as the Condition
  4. Select Yearly as the Value.
  5. Click Add to List then Ok twice to exit the dialog and apply the filter.

This filter won't help with sorting, because you can't sort by the recurrence pattern as that field sorts alphabetically.

The solution: use a macro to add a custom number field to the birthday events then add the custom field to the view and sort by it. By using a decimal format for the month and day, the events will be in chronological order for the current year.

Use a custom number field to sort by birthday

To add the field to the view in Outlook 2013 or Outlook 2010

  1. Click View Settings then Columns (or Fields in older versions of Outlook).
  2. Select User-defined fields in folder from the
  3. Select available columns from dropdown
  4. Select the newly created field and click Add ->.
  5. Click Ok twice to exit the dialog and return to Outlook.

The macro and custom views will work with all versions of Outlook.

Sort by Birthday macro

Select the birthdays (or any recurring events) and run the macro to add a field to each event that contains the start date as a number in decimal format. You'll need to run this on new birthday events after they are added or before you want to sort but birthday.

Public Sub SortBirthdayMonthDay()
    Dim currentExplorer As Explorer
    Dim Selection As Selection
    Dim obj As Object
    Dim objProp As Outlook.UserProperty
    Dim strMonth
     
     
    Set currentExplorer = Application.ActiveExplorer
    Set Selection = currentExplorer.Selection
 
    On Error Resume Next
 
    For Each obj In Selection
         Set objAppt = obj
          
         strMonth = Month(objAppt.Start) & "." & Day(objAppt.Start)
         
         Set objProp = objAppt.UserProperties.Add("Birth Month.Day", olNumber, True)
         objProp.value = strMonth
        objAppt.Save
  
        Err.Clear
    Next
  
    Set currentExplorer = Nothing
    Set obj = Nothing
    Set Selection = Nothing
End Sub

How to use macros

First: You will need macro security set to low during testing.

To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Open the VBA Editor by pressing Alt+F11 on your keyboard.

To put the code in a module:

  1. Right click on Project1 and choose Insert > Module
  2. Copy and paste the macro into the new module.

More information as well as screenshots are at How to use the VBA Editor

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

If the Post Coment button disappears, press your Tab key.