ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can you attach an alert to a date in excel(eg to outlook calendar (https://www.excelbanter.com/excel-discussion-misc-queries/137232-can-you-attach-alert-date-excel-eg-outlook-calendar.html)

Total Excel Dunce

Can you attach an alert to a date in excel(eg to outlook calendar
 
Can I attach alerts to dates in an excel spreadsheet, for example so that a
reminder will go off in my outlook when the date arrives?

Bernie Deitrick

Can you attach an alert to a date in excel(eg to outlook calendar
 
Dunce,

Copy the code below into a codemodule, and set a reference to Outlook. Then select the cells with
the dates, and run the macro. It will create an appointment at 8:00 on the date of each cell.

HTH,
Bernie
MS Excel MVP

Sub CreateOutlookAppointments()
Dim OL As Object
Dim myAppt As Outlook.AppointmentItem
Dim myCell As Range

Set OL = CreateObject("outlook.application")

For Each myCell In Selection
Set myAppt = OL.CreateItem(olAppointmentItem)
With myAppt
.Body = "An important reminder"
.Start = myCell.Value + 8 / 24
.Subject = "This is an important reminder"
.Save
End With
Next myCell
End Sub



"Total Excel Dunce" <Total Excel wrote in message
...
Can I attach alerts to dates in an excel spreadsheet, for example so that a
reminder will go off in my outlook when the date arrives?




Ben

Can you attach an alert to a date in excel(eg to outlook calen
 
Hi Bernie, what do you mean by "set a reference to Outlook. Then select the
cells with the dates, and run the macro". I have limited knowledge of macros
so can you detail for me the process.

Cheers

"Bernie Deitrick" wrote:

Dunce,

Copy the code below into a codemodule, and set a reference to Outlook. Then select the cells with
the dates, and run the macro. It will create an appointment at 8:00 on the date of each cell.

HTH,
Bernie
MS Excel MVP

Sub CreateOutlookAppointments()
Dim OL As Object
Dim myAppt As Outlook.AppointmentItem
Dim myCell As Range

Set OL = CreateObject("outlook.application")

For Each myCell In Selection
Set myAppt = OL.CreateItem(olAppointmentItem)
With myAppt
.Body = "An important reminder"
.Start = myCell.Value + 8 / 24
.Subject = "This is an important reminder"
.Save
End With
Next myCell
End Sub



"Total Excel Dunce" <Total Excel wrote in message
...
Can I attach alerts to dates in an excel spreadsheet, for example so that a
reminder will go off in my outlook when the date arrives?






All times are GMT +1. The time now is 10:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com