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

G

Guest

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?
 
B

Bernie Deitrick

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top