Skip to main content

How to create Outlook reminders from Excel spreadsheet?

This article is talking about creating Outlook reminders based on data of Excel spreadsheet.

Crete Outlook reminders from Excel spreadsheet with VBA code


Create Outlook reminders from Excel spreadsheet with VBA code

If you want to create Outlook reminders from Excel, please do as follows.

1. Create a worksheet contains the column headers and corresponding reminder fields as below screenshot shown.

Note: For the busy status column, number 2 means that the reminder will be shown as Busy in your Outlook calendar. You can change it to 1 (Tentative), 3 (Out of Office), 4 (Working elsewhere), or 5 (Free) as you need.

2. Press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.

3. In the Microsoft Visual Basic for Applications window, click Insert > Module. Then copy below VBA code into the Code window.

VBA code: Create Outlook reminders from Excel spreadsheet

Sub AddAppointments()
'Update by Extendoffice 20180608
    Dim I As Long
    Dim xRg As Range
    Dim xOutApp As Object
    Dim xOutItem As Object
    Set xOutApp = CreateObject("Outlook.Application")
    Set xRg = Range("A2:G2")
    For I = 1 To xRg.Rows.Count
        Set xOutItem = xOutApp.createitem(1)
        Debug.Print xRg.Cells(I, 1).Value
        xOutItem.Subject = xRg.Cells(I, 1).Value
        xOutItem.Location = xRg.Cells(I, 2).Value
        xOutItem.Start = xRg.Cells(I, 3).Value
        xOutItem.Duration = xRg.Cells(I, 4).Value
        If Trim(xRg.Cells(I, 5).Value) = "" Then
            xOutItem.BusyStatus = 2
        Else
            xOutItem.BusyStatus = xRg.Cells(I, 5).Value
        End If
        If xRg.Cells(I, 6).Value > 0 Then
            xOutItem.ReminderSet = True
            xOutItem.ReminderMinutesBeforeStart = xRg.Cells(I, 6).Value
        Else
            xOutItem.ReminderSet = False
        End If
        xOutItem.Body = xRg.Cells(I, 7).Value
        xOutItem.Save
        Set xOutItem = Nothing
    Next
    Set xOutApp = Nothing
End Sub

Note: In the above code, A2:G2 is the data range that you want to create appointments based on.

4. Press the F5 key or click the Run button to run the code. Then all the appointments with specific fields will be inserted into the calendar of your Outlook at once.

And then, you can go to the Calendar of your outlook to view the results, See screenshot: 


Best Office Productivity Tools

Kutools for Outlook - Over 100 Powerful Features to Supercharge Your Outlook

Email Automation: Auto Reply (Out of Office)  /  Schedule Send emails  /  Auto CC/BCC  /  Advanced Auto Forward  /  Auto Add Greating ...

Email Management: Easily Recall Emails  /  Block Scam Emails  /  Delete Duplicate Emails  /  🔎Advanced Search  /  Consolidate Folders ...

📁 Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

🌟 Interface & Interaction Magic: 😊More Pretty and Cool Emojis   /  Brings Browser Tabs Right Into Your Outlook  /  Minimize Outlook Instead of Closing ...

👍 One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  🕘Show Sender's Time Zone  /  Send to Recipients Separately ...

👩🏼‍🤝‍👩🏻 Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Over 100 Features Await Your Exploration! Click Here to Discover More.

Read More       Free Download      Purchase
 
Comments (59)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
HI Crystal,
the code worked find, but I made some changes in Table & run the code again, now I have 2 reminders for same event, how to remove 1st reminder from my outlook calendar.
This comment was minimized by the moderator on the site
If we share the excel with other user and they run this micro-enabled filed, will they have all the invites saved?
This comment was minimized by the moderator on the site
Hi,
If you save this Excel file as an Excel Macro-Enabled Workbook and send it to someone else, the invitation will be saved in their Outlook calendar after running the VBA code.
This comment was minimized by the moderator on the site
Excellent, thanks!
Rated 5 out of 5
This comment was minimized by the moderator on the site
Hi Crystal,

Thank you for letting me know.
This comment was minimized by the moderator on the site
Thank you for posting your code, it works perfectly for me for adding to Outlook. Is there a way to add it to a Google Calendar instead?

Thanks.
This comment was minimized by the moderator on the site
Hi David Ramsay,
I can’t fix this problem. Sorry about that.
This comment was minimized by the moderator on the site
Hello,

For some reason it won’t pull all dates.
My range is A2:C14 and it seems to cherry pick dates. Any tips?
This comment was minimized by the moderator on the site
Hi Hailey,
You may need to attach a screenshot or a sample file to describe the problem you encountered more clearly.
This comment was minimized by the moderator on the site
Hello Crystal,
I would like to track time sheet in excel, wherein if any employee missed to register working hours against project then reminder email should generate next day. Can you help me in this for VBA code.
This comment was minimized by the moderator on the site
Thank you for putting out great Excel info and this VBA code is pretty amazing. I was wondering if it would be possible to tweak the VBA code so that when any date, in any cell in a column is clicked, it opens an outlook new appointment for the date just clicked. I would love it if the information from the same row, specifically column B2, could be captured in the outlook appointment Title and the rest of the information from the same row be captured in the appt description.  I was thinking there must be an Excel, Outlook add-in that would make this way easier but haven’t been able to find one online. Maybe that isn’t the answer but thinking of what I can do. Thanks, in advance, for any help you can lend and looking forward to your feedback. Have a great day!
This comment was minimized by the moderator on the site
Hi Kevin,Take the table below as an example, dates listing in the range C2:C7, to create an Outlook new appointment for the date cell clicked, and add the information from the same row to the appointment as well. You can try the following VBA code. Hope I can help. Thank you.

<div data-tag="code">Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Updated by Extendoffice 20220225
Dim I As Long
Dim xRg As Range
Dim xOutApp As Object
Dim xOutItem As Object
Dim xRow As Integer
If Intersect(Range("C2:C7"), Target) Is Nothing Then Exit Sub
If Intersect(Range("A2:G7"), Target) Is Nothing Then Exit Sub
Set xOutApp = CreateObject("Outlook.Application")
Set xRg = Range("A2:G7")
xRow = Target.Row - 1
I = xRow
Set xOutItem = xOutApp.createitem(1)
xOutItem.Subject = xRg.Cells(I, 1).Value
xOutItem.Location = xRg.Cells(I, 2).Value
xOutItem.Start = xRg.Cells(I, 3).Value
xOutItem.Duration = xRg.Cells(I, 4).Value
If Trim(xRg.Cells(I, 5).Value) = "" Then
xOutItem.BusyStatus = 2
Else
xOutItem.BusyStatus = xRg.Cells(I, 5).Value
End If
If xRg.Cells(I, 6).Value > 0 Then
xOutItem.ReminderSet = True
xOutItem.ReminderMinutesBeforeStart = xRg.Cells(I, 6).Value
Else
xOutItem.ReminderSet = False
End If
xOutItem.Body = xRg.Cells(I, 7).Value
xOutItem.Save
Set xOutItem = Nothing
Set xOutApp = Nothing
End Sub
This comment was minimized by the moderator on the site
I guess the xlsm file itself isn't allowed to be uploaded so here are the screenshots
This comment was minimized by the moderator on the site
Hi ,You may have entered the debug mode of the code window. Please click the red circle in front of the line to cancel the debug mode (the red dot disappears at this point), and then click the "Reset" button to cancel the highlighting of the code. Then try the code again.
This comment was minimized by the moderator on the site
Hello Crystal,I recreated the example in your image and added the code but couldn't get it to work.  Could you please take a look and let me know what I did wrong?Thank you for all your help!
This comment was minimized by the moderator on the site
Hi Crystal!
Thank you for the modification and apologize for the delayed response. I will give the code a try and let you know.
Thanks again for all your help Crystal!! ☜(゚ヮ゚☜)
This comment was minimized by the moderator on the site
is it possible to have one column for start date and one for the start time?
This comment was minimized by the moderator on the site
is there a way to set the start time with a column for the start date and one for the start time

This comment was minimized by the moderator on the site
Hi, I wanted to include this in a shared document as we all share one and write tasks assigned to each one of us. How do I get the email id of the one who has been assigned the task and create a reminder in their outlook respectively ? 
Thanks
This comment was minimized by the moderator on the site
Hi,
Sorry I can't solve this problem. I suggest you post the problem to the forum below to get help from other Excel enthusiasts.
https://www.extendoffice.com/forum/kutools-for-excel.html 
This comment was minimized by the moderator on the site
Error "This object does not support this action" on xOutItem.ReminderMinutesBeforeStart = xRg.Cells(I, 6).Value
This comment was minimized by the moderator on the site
Hi, many thanks for this code. It work beautifully on windows. Do you happen to know how i can implement this on Mac? I've been trying to find a way for a few days now, one way i've found is to create an AppleScript but i have no knowledge of how to do this. Another way was to use a Virtual Machine running Windows 10 however it's not my ideal way of working.
This comment was minimized by the moderator on the site
Hi, is it possible to specify which calendar the reminder will be added to. I would like to add them to a shared mailbox calendar so all in the team get the reminder, rather than my personal email calendar
This comment was minimized by the moderator on the site
Hi! 
Did you find a way to add the reminder(s) to the entire team? I want to include one more person only and I am wondering whether possible and how to do this
This comment was minimized by the moderator on the site
So we have an excel spreadsheet that we enter expiration dates for licenses, and we are wondering how we would do it so that when we add new expiration dates it will automatically add them to our outlook calendar with reminders a month prior and 2 weeks prior. What would that require?
This comment was minimized by the moderator on the site
i have some dynamic table in excel to be made available in body of reminder. Can we do that ? please suggest how
This comment was minimized by the moderator on the site
Hello,

When I follow the exact steps with Microsoft Outlook open and running in the background, running the macro gives me an error " Compile error: invalid outside procedure". Any help would be appreciated.

Thanks
This comment was minimized by the moderator on the site
Hi Abe,
As the reminder fields have been created in a worksheet, you need to add the code to Microsoft Excel workbook's Module code window and run it in Excel.
This comment was minimized by the moderator on the site
Hi, Is there a way to automate running this code, eg. when opening outlook?
This comment was minimized by the moderator on the site
Hi chan,
As the code is saved in Excel workbook, we can't automatically run it when opening Outlook. Sorry for that.
This comment was minimized by the moderator on the site
Hi..
Shall we run this macro everytime to activate the reminder ? or we only need to click just once ? then its ok tu torn of the computer and close the excel file ?

Thanks.
This comment was minimized by the moderator on the site
Hi Juicy,
Just need one click to run the code, then prepared reminders will be automatically created in the Outlook calendar. After that, you can do anything as you like.
This comment was minimized by the moderator on the site
when we use VBA code for reminder then error shows
Compliler error :
User define type is not define
after press ok button
cursor move on DIM xRg as Range

please help...??
This comment was minimized by the moderator on the site
Hi vineet,
Sorry for the inconvenience. Which Excel version are you using?
This comment was minimized by the moderator on the site
If I use this in a gantt chart and I update due dates must I re run? Is there an easy way to remove from calendar without deleting each individual one?
This comment was minimized by the moderator on the site
Hi,

Is it possible to use code to make entry on group calendar in outlook?
This comment was minimized by the moderator on the site
Hi,
Sorry can't help solving the problem yet.
This comment was minimized by the moderator on the site
Do you know how i can put a all day event?
This comment was minimized by the moderator on the site
Hi,
Sorry can't help solving the problem yet.
This comment was minimized by the moderator on the site
dear webmaster
thank you for the code. I have a problem as it failed to implemented. (run-time error '-21447467263 (80004001)' : Not implemented.
when I press the debug button it highlights the "xOutItem.Save" code line 28.
could you give solution of this issue?
regards
Singgih
This comment was minimized by the moderator on the site
Hi singgih,
Sorry for replying so late. I need to know your Excel version in order to figure out the problem. Thank you for your comment.
This comment was minimized by the moderator on the site
Hi Crystal! Great code.

I need to add/invite attendees. Any idea?
This comment was minimized by the moderator on the site
how to add others attendees as well in this appointment.
This comment was minimized by the moderator on the site
Hi Dharma,
Sorry the probem can't be solved yet. Thank you for your comment.
This comment was minimized by the moderator on the site
this code works but only for the first entry. How do you adjust it for range: Sheet3!A2:G17 ?

I changed the code to say: Set xRg = Range("Set xRg = Range("A2:G2") Yet it still only picks the first line up in outlook.
This comment was minimized by the moderator on the site
Good day,
Please replace the line Set xRg = Range("A2:G2") with Set xRg = Worksheets("Sheet3").Range("A2:G17").
Thank you for your comment.
This comment was minimized by the moderator on the site
Hi Crystal,
I already replaced the line and it works, but 'body' in second row and so on are not come out in reminder, but only picks first row.
Please advise..
This comment was minimized by the moderator on the site
Hello, the code seems very helpful but has one drawback, If the file is updated continuously it will create a new reminder each time it is run. Can a line be added to delete all previous reminders and then create new ones?
Also can this be exported to multiple outlook accounts?
This comment was minimized by the moderator on the site
Hi Keith,
Sorry can't help you with that. You need to delete all previous reminders manually in Outlook. And the reminders are added to the default Outlook account only. Thank you for your comment.
This comment was minimized by the moderator on the site
This has the potential to be a big help.  Thanks!.  Can you add a marker in a new column that gets turned on when a reminder is generated for that row (either manual or automated), but then skips rows with markers the next time you run the macro? 
This comment was minimized by the moderator on the site
Hello! Love the idea of this code, but I have a few questions:


1. It won't run because of the "bug" on this line (error 440, Run time error):
xOutItem.ReminderMinutesBeforeStart = xRg.Cells(I, 6).Value
2. If I don't necessarily want to put the column headers from A2:G2, can i just simply change it in the code (ex: F3-K3), will it still work?
3. How does it know to connect to my outlook?


Thank you for your response, I'd really appreciate it!
This comment was minimized by the moderator on the site
Hi Alexandra,
The 440 error didn't occur in my case. Which Office version do you use?
The code won't work if you simply change the code to F3:K3. If you need the answer, i will try to figure it out.
This line "Set xOutApp = CreateObject("Outlook.Application")" will help to connect the Excel data to the Outlook application.
Thank you for your comment.
This comment was minimized by the moderator on the site
Hello, thank you for the code but I'm struggling with it only putting in the first entry in excel into Outlook. How do i get it to enter in all line items?
Here is my code, I added in a category color


Sub AddAppointments()
'Update by Extendoffice 20180608
Dim I As Long
Dim xRg As Range
Dim xOutApp As Object
Dim xOutItem As Object
Set xOutApp = CreateObject("Outlook.Application")
Set xRg = Range("A2:G2")
For I = 1 To xRg.Rows.Count
Set xOutItem = xOutApp.createitem(1)
Debug.Print xRg.Cells(I, 1).Value
xOutItem.Subject = xRg.Cells(I, 1).Value
xOutItem.Location = xRg.Cells(I, 2).Value
xOutItem.Start = xRg.Cells(I, 3) + xRg.Cells(I, 8).Value
xOutItem.Duration = xRg.Cells(I, 4).Value
xOutItem.Categories = xRg.Cells(I, 9).Value
If Trim(xRg.Cells(I, 5).Value) = "" Then
xOutItem.BusyStatus = 2
Else
xOutItem.BusyStatus = xRg.Cells(I, 5).Value
End If
If xRg.Cells(I, 6).Value > 0 Then
xOutItem.ReminderSet = True
xOutItem.ReminderMinutesBeforeStart = xRg.Cells(I, 6).Value
Else
xOutItem.ReminderSet = False
End If
xOutItem.Body = xRg.Cells(I, 7).Value
xOutItem.Save
Set xOutItem = Nothing
Next
Set xOutApp = Nothing
End Sub
This comment was minimized by the moderator on the site
in row 8 of the code:
"Set xRg = Range("A2:G2")"

change the number after the G to how ever many rows you want to enter at once.

ie:
"Set xRg = Range("A2:G101")"
you will have 100 events in your calendar
This comment was minimized by the moderator on the site
I'm having the same issue, the code works great but is only adding the first appointment to the calendar. Here is my code:
<code>
Sub AddAppointments()
'Update by Extendoffice 20180608
Dim I As Long
Dim xRg As Range
Dim xOutApp As Object
Dim xOutItem As Object
Set xOutApp = CreateObject("Outlook.Application")
Set xRg = Range("A2:G2")
For I = 1 To xRg.Rows.Count
Set xOutItem = xOutApp.createitem(1)
Debug.Print xRg.Cells(I, 1).Value
xOutItem.Subject = xRg.Cells(I, 1).Value
xOutItem.Location = xRg.Cells(I, 2).Value
xOutItem.Start = xRg.Cells(I, 3).Value
xOutItem.Duration = xRg.Cells(I, 4).Value
If Trim(xRg.Cells(I, 5).Value) = "" Then
xOutItem.BusyStatus = 2
Else
xOutItem.BusyStatus = xRg.Cells(I, 5).Value
End If
If xRg.Cells(I, 6).Value > 0 Then
xOutItem.ReminderSet = True
xOutItem.ReminderMinutesBeforeStart = xRg.Cells(I, 6).Value
Else
xOutItem.ReminderSet = False
End If
xOutItem.Body = xRg.Cells(I, 7).Value
xOutItem.Save
Set xOutItem = Nothing
Next
Set xOutApp = Nothing
End Sub
</code>
This comment was minimized by the moderator on the site
You need to change Set xRg = Range("A2:G2") to be A":wherever your data ends, so if you have 20 rows it will be A2:G20.
This comment was minimized by the moderator on the site
Hi There,

Great formula/code.


What happens that this code generates multiple entries in the outlook calendar if its run more than once by mistake. I also wanted it to be setup as a template so that staff can use it. They can put in the dates and rest of the details are required and when they run it should list the entries in outlook calendar. Any deleted excel data should be deleted from outlook as well and same applies to any changes. When I save the excel spreadsheet it saves in the default excel format, but I want it to be saved with Macros so that it does not lose the code and staff can use it as many times as needed. Can you please advise and make relevant changes to the code? Thanks
This comment was minimized by the moderator on the site
Hi,
For saving the macros for future use in the Workbook, you need to click File > Save As > Browse > select a folder to save the workbook > choose “Excel Macro-enabled Workbook” from the Save as type drop-down > Save.
This comment was minimized by the moderator on the site
Hi,

How can I send the reminders to multiple people? Please help.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations